Part Number Hot Search : 
RF3928SQ 2N2906E C6707 178305 ZVP2110 PL100 TLMO3301 2C100
Product Description
Full Text Search
 

To Download MC68HC705J2 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 Freescale Semiconductor, Inc.
MC68HC705J2/D Rev. 2
Freescale Semiconductor, Inc...
HC05
MC68HC705J2
TECHNICAL DATA
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
MC68HC705J2
HCMOS MICROCONTROLLER UNIT
Freescale Semiconductor, Inc...
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
NOTE
Change bars indicate changes to manual.
Freescale Semiconductor, Inc...
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
TABLE OF CONTENTS Paragraph Title Page
1.1 1.2
SECTION 1 INTRODUCTION Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Freescale Semiconductor, Inc...
SECTION 2 PIN DESCRIPTIONS 2.1 VDD and VSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.2 OSC1 and OSC2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.2.1 Crystal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.2.2 Ceramic Resonator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.2.3 External Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 2.3 IRQ/VPP (External Interrupt Request/Programming Voltage) . . . . . . . . . . . . . . 2-4 2.4 SECTION 3 PARALLEL I/O I/O Port Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
3.1 3.2 3.3
SECTION 4 CENTRAL PROCESSOR UNIT 4.1 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 4.1.1 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.1.2 Index Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.1.3 Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.1.4 Program Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.1.5 Condition Code Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.1.5.1 Half-Carry Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.1.5.2 Interrupt Mask. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.1.5.3 Negative Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.1.5.4 Zero Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.1.5.5 Carry/Borrow Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.2 Arithmetic/Logic Unit (ALU). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.3 Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.3.1 STOP Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.3.2 WAIT Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Rev. 2
For More Information On This Product, Go to: www.freescale.com
iii
Freescale Semiconductor, Inc.
TABLE OF CONTENTS Paragraph Title Page
Freescale Semiconductor, Inc...
SECTION 5 RESETS AND INTERRUPTS 5.1 Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.1.1 Power-On Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.1.2 External Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.1.3 Computer Operating Properly (COP) Reset . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.1.4 Illegal Address Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.2 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 5.2.1 Timer Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5.2.1.1 Timer Overflow Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5.2.1.2 Real-Time Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5.2.2 External Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5.2.3 Software Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 SECTION 6 MEMORY 6.1 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.1.1 Input/Output Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.1.2 RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.1.3 EPROM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 6.1.3.1 EPROM Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 6.1.3.2 EPROM Erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 6.1.4 Bootloader ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 6.2 Data Retention Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 SECTION 7 TIMER Timer Counter Register (TCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Timer Control and Status Register (TCSR). . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 COP Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7.1 7.2 7.3
SECTION 8 BOOTLOADER MODE 8.1 Bootloader ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 8.1.1 External EPROM Downloading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 8.2 Host Downloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3 8.3 Mask Option Register (MOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4 SECTION 9 MC68HC05J1 EMULATION MODE Bootloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1 MC68HC05J1 Emulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9.1 9.2 9.3
iv
For More Information On This Product, Go to: www.freescale.com
Rev. 2
Freescale Semiconductor, Inc.
TABLE OF CONTENTS Paragraph Title Page
Freescale Semiconductor, Inc...
SECTION 10 INSTRUCTION SET 10.1 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1 10.1.1 Inherent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1 10.1.2 Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1 10.1.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 10.1.4 Extended. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 10.1.5 Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 10.1.6 Indexed, 8-Bit Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 10.1.7 Indexed, 16-Bit Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3 10.1.8 Relative. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3 10.2 Instruction Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3 10.2.1 Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4 10.2.2 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 10.2.3 Jump/Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 10.2.4 Bit Manipulation Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7 10.2.5 Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7 10.3 Instruction Set Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8 SECTION 11 ELECTRICAL SPECIFICATIONS Power Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 DC Electrical Characteristics (VDD = 5.0 Vdc) . . . . . . . . . . . . . . . . . . . . . . . . 11-3 DC Electrical Characteristics (VDD = 3.3 Vdc) . . . . . . . . . . . . . . . . . . . . . . . . 11-4 Control Timing (VDD = 5.0 Vdc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7 Control Timing (VDD = 3.3 Vdc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8 SECTION 12 MECHANICAL SPECIFICATIONS Plastic Dual In-Line Package (DIP). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2 Small Outline Integrated Circuit (SOIC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3 Ceramic DIP (Cerdip) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
11.3 11.4 11.5 11.6 11.7
12.1 12.2 12.3
Rev. 2
For More Information On This Product, Go to: www.freescale.com
v
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
vi
For More Information On This Product, Go to: www.freescale.com
Rev. 2
Freescale Semiconductor, Inc.
1 2
LIST OF FIGURES Figure 1-1 2-1 2-2 2-3 3-1 3-2 3-3 3-4 3-5 4-1 4-2 4-3 5-1 5-2 5-3 5-4 6-1 6-2 6-3 7-1 7-2 7-3 7-4 8-1 8-2 9-1 Title Page
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
MC68HC705J2 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 Crystal/Ceramic Resonator Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 External Clock Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Parallel I/O Port Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Port A Data Direction Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Port B Data Direction Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 3-3 3-3 3-4 3-4
Freescale Semiconductor, Inc...
Programming Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 STOP Instruction Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 WAIT Instruction Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8 COP Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interrupt Stacking Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interrupt Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . External Interrupt Trigger Option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5-3 5-5 5-6
Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 I/O Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 EPROM Programming Register (PROG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timer Counter Register (TCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timer Control and Status Register (TCSR). . . . . . . . . . . . . . . . . . . . . . . . . . . COP Register (COPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 7-2 7-2 7-4
Bootloader Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 Mask Option Register (MOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4 MC68HC05J1 Emulation Mode Memory Map. . . . . . . . . . . . . . . . . . . . . . . . . 9-2
11-1 Equivalent Test Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4 11-2 Typical High-Side Driver Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5 11-3 Typical Low-Side Driver Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Rev. 2
For More Information On This Product, Go to: www.freescale.com
vii
Freescale Semiconductor, Inc.
LIST OF FIGURES Figure Title Page
2 3 4 5
11-4 11-5 11-6 11-7 11-8 11-9
Typical Supply Current vs Clock Frequency . . . . . . . . . . . . . . . . . . . . . . . . . 11-6 Maximum Supply Current vs Clock Frequency . . . . . . . . . . . . . . . . . . . . . . . 11-6 External Interrupt Timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7 STOP Recovery Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9 Power-On Reset Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10 External Reset Timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
Freescale Semiconductor, Inc...
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
12-1 MC68HC705J2P (Case 738-03) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2 12-2 MC68HC705J2DW (Case 751D-04) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3 12-3 MC68HC705J2S (Case 732-03) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
viii
For More Information On This Product, Go to: www.freescale.com
Rev. 2
Freescale Semiconductor, Inc.
LIST OF TABLES Table 3-1 7-1 Title Page
I/O Pin Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Real-Time Interrupt Rate Selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3 Bootloader Function Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 Register/Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4 Read-Modify-Write Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 Jump and Branch Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6 Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7 Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7 Instruction Set Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8 Opcode Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14 Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Thermal Resistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DC Electrical Characteristics (VDD = 5.0 Vdc) . . . . . . . . . . . . . . . . . . . . . . . DC Electrical Characteristics (VDD = 3.3 Vdc) . . . . . . . . . . . . . . . . . . . . . . . Control Timing (VDD = 5.0 Vdc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control Timing (VDD = 3.3 Vdc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1 11-1 11-3 11-4 11-7 11-8
Freescale Semiconductor, Inc...
8-1 10-1 10-2 10-3 10-4 10-5 10-6 10-7 11-1 11-2 11-3 11-4 11-5 11-6
Rev. 2
For More Information On This Product, Go to: www.freescale.com
ix
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
x
For More Information On This Product, Go to: www.freescale.com
Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 1 INTRODUCTION The MC68HC705J2 is a member of the low-cost, high-performance M68HC05 Family of 8-bit microcontroller units (MCUs). The high-density, complementary metal-oxide semiconductor (HCMOS) M68HC05 Family is based on the customer-specified integrated circuit (CSIC) design strategy. All MCUs in the family use the popular M68HC05 central processor unit (CPU) and are available with a variety of subsystems, memory sizes and types, and package types. The MC68HC705J2 is an expansion of the MC68HC05J1 design. On-chip memory is enhanced with 2 Kbytes of erasable, programmable ROM (EPROM), 112 Kbytes of RAM, and a bootloader ROM. 1.1 Features The MCU features include the following: * * * * * * * * * * * * * * * * Popular M68HC05 CPU Memory-Mapped Input/Output (I/O) Registers 2064 Bytes of User EPROM Including 16 User Vector Locations 112 Bytes of Static RAM (SRAM) 14 Bidirectional I/O Pins Fully Static Operation With No Minimum Clock Speed On-Chip Oscillator With Crystal/Ceramic Resonator Connections 15-Bit Multifunction Timer Real-Time Interrupt Circuit Bootloader ROM Power-Saving STOP, WAIT, and Data Retention Modes MC68HC05J1 Emulation Mode Selectable Edge-Sensitive or Edge- and Level-Sensitive External Interrupt Trigger Selectable Computer Operating Properly (COP) Timer 8 x 8 Unsigned Multiply Instruction One Time Programmable 20-Pin Dual-in-Line Package (DIP)
INTRODUCTION Rev. 2 For More Information On This Product, Go to: www.freescale.com 1-1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc.
*
One Time Programmable 20-Pin Small Outline Integrated Circuit (SOIC) Windowed 20-Pin Cerdip
1 2 3 4 5
*
1.2 Structure Figure 1-1 shows the organization of the MC68HC705J2 EPROM MCU.
USER EPROM -- 2064 BYTES
Freescale Semiconductor, Inc...
6 7 8
IRQ/VPP RESET RST
BOOTLOADER ROM -- 239 BYTES
SRAM -- 112 BYTES PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
7
0
ACCUMULATOR
9
7
0
INDEX REGISTER
10 11 12 13 14 15 16 17 18 19 20
V DD VSS OSC1 OSC2
15 7 5 0000000011 15 11 00000
0
STACK POINTER
0
PROGRAM COUNTER
PORT A
M68HC05 CPU
DATA DIRECTION A
CONDITION CODE REGISTER
OSCILLATOR
DIVIDE BY 2
f op
COP TIMER AND ILLEGAL ADDRESS DETECT
15-STAGE MULTIFUNCTION TIMER
POWER
Figure 1-1. MC68HC705J2 Block Diagram
INTRODUCTION 1-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
PORT B
7 0 111HINZC
PB5 PB4 PB3 PB2 PB1 PB0
DATA DIRECTION B
Freescale Semiconductor, Inc.
1
SECTION 2 PIN DESCRIPTIONS This section describes the function of each pin. Figure 2-1 shows the pin assignments.
2 3 4 5
Freescale Semiconductor, Inc...
6
OSC1 1 20 RESET OSC2 2 19 IRQ/VPP
7 8 9 10
OSC1 OSC2 PB5 PB4 PB3 PB2 PB1 PB0 VDD VSS 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 RESET IRQ/VPP PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7
PB5
3
18
PA0
PB4
4
17
PA1
PB3
5
16
PA2
PB2
6
15
PA3
11 12 13 14 15
PB1
7
14
PA4
PB0
8
13
PA5
VDD VSS
9
12
PA6
10
11
PA7
DIP/CERDIP
SOIC
Figure 2-1. Pin Assignments
16 17 18 19 20
PIN DESCRIPTIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 2-1
Freescale Semiconductor, Inc.
1 2 3 4 5
2.1 VDD and VSS VDD and VSS are the power supply and ground pins. The MCU operates from a single 5-V power supply. Very fast signal transitions occur on the MCU pins. The short rise and fall times place very high short-duration current demands on the power supply. To prevent noise problems, take special care to provide good power supply bypassing at the MCU. Use bypass capacitors with good high-frequency characteristics, and position them as close to the MCU as possible. Bypassing requirements vary, depending on how heavily loaded the MCU pins are. 2.2 OSC1 and OSC2 The OSC1 and OSC2 pins are the control connections for the on-chip oscillator. Connect any of the following to the OSC1 and OSC2 pins: * * * A crystal (Refer to Figure 2-2.) A ceramic resonator (Refer to Figure 2-2) An external clock signal (Refer to Figure 2-3)
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15
The MCU divides the frequency, fosc, of the oscillator or external clock source by two to produce the internal operating frequency, fop. 2.2.1 Crystal The circuit in Figure 2-2 shows a typical crystal oscillator circuit for a parallel resonant crystal. Follow the crystal supplier's recommendations, as the crystal parameters determine the external component values required to provide maximum stability and reliable start-up. The load capacitance values used in the oscillator circuit design should include all stray layout capacitances. Mount the crystal and components as close as possible to the pins for start-up stabilization and to minimize output distortion. 2.2.2 Ceramic Resonator In cost-sensitive applications, use a ceramic resonator in place of the crystal. Use the circuit in Figure 2-2 for a ceramic resonator, and follow the resonator manufacturer's recommendations, as the resonator parameters determine the external component values required for maximum stability and reliable starting. The load capacitance values used in the oscillator circuit design should include all stray layout capacitances.
16 17 18 19 20
PIN DESCRIPTIONS 2-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
STOP
1 2
OSC1 4.7 M OSC2
3 4
XTAL 37 pF 37 pF
5 6
Freescale Semiconductor, Inc...
Figure 2-2. Crystal/Ceramic Resonator Connections 2.2.3 External Clock An external clock from another CMOS-compatible device can drive the OSC1 input, with the OSC2 pin not connected, as Figure 2-3 shows.
7 8 9 10 11
STOP
12 13
OSC1 OSC2 NOT CONNECTED EXTERNAL CMOS CLOCK
14 15 16
Figure 2-3. External Clock Connections
17 18 19 20
PIN DESCRIPTIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 2-3
Freescale Semiconductor, Inc.
2.3 RESET
1 2 3 4 5
A zero on the RESET pin forces the MCU to a known start-up state. See 5.1 Resets for more information. 2.4 IRQ/VPP (External Interrupt Request/Programming Voltage) The IRQ/VPP pin has the following functions: * * Applying asynchronous external interrupt signals (See 5.2 Interrupts.) Applying the programming voltage for programming the EPROM (See 6.1.3.1 EPROM Programming and 8.1.1 External EPROM Downloading.)
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
PIN DESCRIPTIONS 2-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 3 PARALLEL I/O This section describes the two bidirectional I/O ports. 3.1 I/O Port Function
2 3 4 5 6 7 8
Freescale Semiconductor, Inc...
The 14 I/O pins form two I/O ports. Each I/O pin is programmable as an input or an output. The contents of a port data direction register (DDR) determine the data direction for the port. Writing a 1 to a DDR bit enables the output buffer for the associated port pin; a 0 disables the output buffer. A reset initializes all implemented DDR bits to 0, configuring all I/O pins as inputs.
NOTE Connect any unused inputs and I/O pins to an appropriate logical level, either VDD or VSS. Although the I/O ports do not require termination for proper operation, termination reduces the possibility of electrostatic damage.
9 10 11 12
A reset does not initialize the two port data registers. The port data registers for ports A and B are at addresses $0000 and $0001. To avoid undefined levels, write the data registers before writing the data direction registers. With an I/O port pin programmed as an output, reading the pin actually reads the value of the output data latch and not the voltage on the pin itself. When a pin is programmed as an input, reading the port bit reads the voltage level on the I/O pin. The output data latch can always be written, regardless of the state of its DDR bit. Refer to Figure 3-1 for typical port circuitry, and to Table 3-1 for a summary of I/O pin functions.
13 14 15 16 17 18 19 20
PARALLEL I/O Rev. 2 For More Information On This Product, Go to: www.freescale.com 3-1
Freescale Semiconductor, Inc.
1
CONNECTIONS TO INTERNAL DATA BUS
2 3 4 5
DATA DIRECTION REGISTER BIT LATCHED OUTPUT DATA BIT [3] I/O PIN
[1]
[2]
Freescale Semiconductor, Inc...
6 7 8 9
R/W
0 0 1 1
[1] Output buffer enables latched output to drive I/O pin when DDR bit is 1 (output mode). [2] Input buffer enabled when DDR bit is 0 (input mode). [3] Input buffer enabled when DDR bit is 1 (output mode).
Figure 3-1. Parallel I/O Port Circuit
Table 3-1. I/O Pin Functions
DDR Bit
0 1 0 1
10 11 12 13 14 15 16 17 18 19 20
I/O Pin Function
The I/O pin is an input. Data is written into the output data latch. Data is written into the output data latch, which drives the I/O pin. The state of the I/O pin is read. The I/O pin is an output. The output data latch is read.
NOTE: R/W is an internal MCU signal.
PARALLEL I/O 3-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
3.2 Port A Port A is an 8-bit general-purpose bidirectional I/O port. The contents of DDRA determine whether each pin is an input or an output. Figure 3-2 and Figure 3-3 show the port A data register and DDRA. PORTA -- Port A Data Register
Bit 7 PA7 RESET: 6 PA6 5 PA5 4 PA4 3 PA3 2 PA2 1 PA1 Bit 0 PA0
1 2
$0000
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
NOT CHANGED BY RESET
Figure 3-2. Port A Data Register
Freescale Semiconductor, Inc...
PA7-PA0 -- Port A Data Bits These read/write bits are software-programmable. Data direction of each bit is under the control of the corresponding DDRA bit. DDRA -- Port A Data Direction Register
Bit 7 0 RESET: 0 6 0 0 5 DDRA5 0 4 DDRA4 0 3 DDRA3 0 2 DDRA2 0 1 DDRA1 0 Bit 0 DDRA0 0
$0004
Figure 3-3. Port A Data Direction Register DDRA7-DDRA0 -- Port A Data Direction Bits These read/write bits control port A data direction. 1 = Corresponding port A pin configured as output 0 = Corresponding port A pin configured as input
PARALLEL I/O Rev. 2 For More Information On This Product, Go to: www.freescale.com 3-3
Freescale Semiconductor, Inc.
3.3 Port B
1 2 3 4 5
Port B is a 6-bit general-purpose bidirectional I/O port. The contents of DDRB determine whether each pin is an input or an output. Figure 3-4 and Figure 3-5 show the port B data register and DDRB. PORTB -- Port B Data Register
Bit 7 0 RESET: 6 0 5 PB5 4 PB4 3 PB3 2 PB2 1 PB1 Bit 0 PB0
$0001
NOT CHANGED BY RESET
Figure 3-4. Port B Data Register PB5-PB0 -- Port B Data Bits These read/write bits are software-programmable. Data direction of each bit is under the control of the corresponding DDRA bit. DDRB -- Port B Data Direction Register
Bit 7 DDRB7 RESET: 0 6 DDRB6 0 5 DDRB5 0 4 DDRB4 0 3 DDRB3 0 2 DDRB2 0 1 DDRB1 0 Bit 0 DDRB0 0
Freescale Semiconductor, Inc...
6 7 8
$0005
9
10 11 12 13 14 15 16 17 18 19 20
Figure 3-5. Port B Data Direction Register DDRB7-DDRB0 -- Port B Data Direction Bits These read/write bits control port B data direction. 1 = Corresponding port B pin configured as output 0 = Corresponding port B pin configured as input
PARALLEL I/O 3-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 4 CENTRAL PROCESSOR UNIT This section describes the registers, aithmetic/logic unit (ALU), and low-power modes of the M68HC05 central processor unit (CPU). 4.1 CPU Registers
2 3 4 5 6 7
Freescale Semiconductor, Inc...
Figure 4-1 shows the five CPU registers. These are hard-wired registers within the CPU and are not part of the memory map.
7 A
0 ACCUMULATOR (A)
8 9
7 X
0
10
INDEX REGISTER (X) 0 SP STACK POINTER (SP)
15 0 0 0 0 0 0 0 0 1
6 1
5
11 12 13
PROGRAM COUNTER (PC)
15 0 0 0
12 11* 0 PCH
8
7 PCL 7 1 1 5 1 4 H I N Z
0
14 15 16 17 18 19 20
0 C CONDITION CODE REGISTER (CCR)
CARRY/BORROW FLAG ZERO PLAN NEGATIVE FLAG INTERRUPT MASK HALF-CARRY FLAG
*Bit 11 of the program counter is fixed at 0 in MC68HC05J1 emulation mode.
Figure 4-1. Programming Model
CENTRAL PROCESSOR UNIT Rev. 2 For More Information On This Product, Go to: www.freescale.com 4-1
Freescale Semiconductor, Inc.
4.1.1 Accumulator
1 2 3 4 5
The accumulator is a general-purpose 8-bit register. The CPU uses the accumulator to hold operands and results of arithmetic and nonarithmetic operations. 4.1.2 Index Register The 8-bit index register can perform two functions: * * Indexed addressing Temporary storage
Freescale Semiconductor, Inc...
6 7 8 9
In indexed addressing, the CPU uses the byte in the index register to determine the conditional address of the operand. The index register can also serve as an auxiliary accumulator for temporary storage. 4.1.3 Stack Pointer The stack pointer is a 16-bit register that contains the address of the next free location on the stack. During a reset or after the reset stack pointer (RSP) instruction, the stack pointer contents are preset to $00FF. The address in the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. The ten most significant bits of the stack pointer are permanently fixed at 0000000011, so the stack pointer produces addresses from $00C0 to $00FF. If subroutines and interrupts use more than 64 stack locations, the stack pointer wraps around to address $00C0 and begins writing over the previously stored data. A subroutine uses two stack locations; an interrupt uses five locations.
10 11 12 13 14 15 16 17 18 19 20
CENTRAL PROCESSOR UNIT 4-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
4.1.4 Program Counter The program counter is a 16-bit register that contains the address of the next instruction or operand to be fetched. The four most significant bits of the program counter are permanently fixed at 0000. In MC68HC05J1 emulation mode, the five most significant bits are fixed at 00000. Normally, the address in the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. Jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. 4.1.5 Condition Code Register
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
The condition code register is an 8-bit register whose three most significant bits are permanently fixed at 111. The condition code register contains the interrupt mask and four flags that indicate the results of the instruction just executed. The following paragraphs describe the functions of the condition code register. 4.1.5.1 Half-Carry Flag The CPU sets the half-carry flag when a carry occurs between bits 3 and 4 of the accumulator during an ADD or ADC operation. The half-carry flag is required for binary-coded decimal (BCD) arithmetic operations. 4.1.5.2 Interrupt Mask Setting the interrupt mask disables interrupts. If an interrupt request occurs while the interrupt mask is zero, the CPU saves the CPU registers on the stack, sets the interrupt mask, and then fetches the interrupt vector. If an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. Normally, the CPU processes the latched interrupt as soon as the interrupt mask is cleared again. A return from interrupt (RTI) instruction pulls the CPU registers from the stack, restoring the interrupt mask to its cleared state. After any reset, the interrupt mask is set and can be cleared only by a software instruction. 4.1.5.3 Negative Flag The CPU sets the negative flag when an arithmetic operation, logical operation, or data manipulation produces a negative result. Bit 7 of the negative result is automatically set, so the negative flag can be used to check an often-tested bit by assigning it to bit 7 of a register or memory location. Loading the accumulator with the contents of that register or location then sets or clears the negative flag according to the state of the tested bit.
CENTRAL PROCESSOR UNIT Rev. 2 For More Information On This Product, Go to: www.freescale.com 4-3
Freescale Semiconductor, Inc.
4.1.5.4 Zero Flag
1 2 3 4 5
The CPU sets the zero flag when an arithmetic operation, logical operation, or data manipulation produces a $00. 4.1.5.5 Carry/Borrow Flag The CPU sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator. Some logical operations and data manipulation instructions also clear or set the carry/borrow flag. 4.2 Arithmetic/Logic Unit (ALU) The ALU performs the arithmetic and logical operations defined by the instruction set. The binary arithmetic circuits decode instructions and set up the ALU for the selected operation. Most binary arithmetic is based on the addition algorithm, carrying out subtraction as negative addition. Multiplication is not performed as a discrete operation but as a chain of addition and shift operations within the ALU. The multiply instruction (MUL) requires 11 internal processor cycles to complete this chain of operations. 4.3 Low-Power Modes The following paragraphs describe the STOP and WAIT modes. (Refer also to 6.2 Data Retention Mode.) 4.3.1 STOP Mode The STOP instruction puts the MCU in its lowest power-consumption mode. In STOP mode, the following events occur: * * * * * The CPU clears TOF and RTIF, the timer interrupt flags in the timer control and status register, removing any pending timer interrupts. The CPU clears TOIE and RTIE, the timer interrupt enable bits in the timer control and status register, disabling further timer interrupts. The CPU clears the divide-by-four timer prescaler. The CPU clears the interrupt mask in the condition code register, enabling external interrupts. The internal oscillator stops, halting all internal processing, including operation of the timer and the COP timer.
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
4-4
The STOP instruction does not affect any other registers or any I/O lines.
CENTRAL PROCESSOR UNIT Rev. 2 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
The following conditions bring the MCU out of STOP mode: * An external interrupt. An external interrupt automatically loads the program counter with the contents of locations $0FFA and $0FFB, the locations of the vector address of the external interrupt service routine. A reset signal on the RESET pin. A reset automatically loads the program counter with the contents of locations $0FFE and $0FFF, the locations of the vector address of the reset service routine.
1 2 3 4 5
*
Refer to Figure 11-7 in SECTION 11 ELECTRICAL SPECIFICATIONS for STOP recovery timing.
Freescale Semiconductor, Inc...
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
CENTRAL PROCESSOR UNIT Rev. 2 For More Information On This Product, Go to: www.freescale.com 4-5
Freescale Semiconductor, Inc.
Figure 4-2 shows the sequence of events caused by the STOP instruction.
1 2 3 4 5
STOP
CLEAR TIMER INTERRUPT FLAGS AND TIMER INTERRUPT ENABLE BITS. CLEAR TIMER PRESCALER. CLEAR CCR INTERRUPT MASK. STOP OSCILLATOR.
Freescale Semiconductor, Inc...
6 7 8
NO NO RESET ? YES EXTERNAL INTERRUPT ? YES
9
10 11 12 13 14 15 16 17 18 19 20
CENTRAL PROCESSOR UNIT 4-6 For More Information On This Product, Go to: www.freescale.com Rev. 2
(1) FETCH RESET VECTOR or (2) SERVICE INTERRUPT. a. SAVE CPU REGISTERS ON STACK. b. SET CCR INTERRUPT MASK. c. VECTOR TO INTERRUPT SERVICE ROUTINE. TURN ON OSCILLATOR. DELAY 4064 CYCLES TO STABILIZE.
Figure 4-2. STOP Instruction Flowchart
Freescale Semiconductor, Inc.
4.3.2 WAIT Mode The WAIT instruction puts the MCU in an intermediate power-consumption mode. In WAIT mode, the following events occur: * * All CPU clocks stop. The CPU clears the interrupt mask in the condition code register, enabling external interrupts and timer interrupts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
The WAIT instruction does not affect any other registers or any I/O lines. The timer and COP timer remain active in WAIT mode. The following conditions bring the MCU out of WAIT mode:
Freescale Semiconductor, Inc...
*
A timer interrupt. If a real-time interrupt or a timer overflow interrupt occurs during WAIT mode, the MCU loads the program counter with the contents of locations $0FF8 and $0FF9, the locations of the vector address of the timer interrupt service routine. An external interrupt. An external interrupt automatically loads the program counter with the contents of locations $0FFA and $0FFB, the locations of the vector address of the external interrupt service routine. A COP timer reset. A timeout of the COP timer during WAIT mode resets the MCU. The programmer can enable real-time interrupts so the MCU can periodically exit WAIT mode to reset the COP timer. A reset signal on the RESET pin during WAIT mode resets the MCU.
*
*
*
A COP timer reset or a reset signal on the RESET pin automatically loads the program counter with the contents of locations $0FFE and $0FFF, the locations of the vector address of the reset service routine. Figure 4-3 shows the sequence of events caused by the WAIT instruction.
CENTRAL PROCESSOR UNIT Rev. 2 For More Information On This Product, Go to: www.freescale.com 4-7
Freescale Semiconductor, Inc.
1 2
WAIT
3 4 5
OSCILLATOR ACTIVE. TIMER CLOCKS ACTIVE. STOP CPU CLOCKS. CLEAR CCR INTERRUPT MASK.
Freescale Semiconductor, Inc...
6 7 8 9
RESET ? YES
NO
EXTERNAL INTERRUPT ? YES YES
NO
10 11 12 13 14 15 16 17 18 19 20
RESTART CPU CLOCK.
INTERNAL TIMER INTERRUPT ? NO
(1) FETCH RESET VECTOR or (2) SERVICE INTERRUPT. a. SAVE CPU REGS ON STACK. b. SET I-BIT IN CCR. c. VECTOR TO INTERRUPT SERVICE ROUTINE.
Figure 4-3. WAIT Instruction Flowchart
CENTRAL PROCESSOR UNIT 4-8 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 5 RESETS AND INTERRUPTS This section describes how resets reinitialize the MCU and how interrupts temporarily change the normal processing sequence. 5.1 Resets
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
A reset immediately stops the operation of the instruction being executed. A reset initializes certain control bits to known conditions and loads the program counter with a user-defined reset vector address. The following conditions produce a reset: * * * * Initial power-up (power-on reset) A logical zero applied to the RESET pin (external reset) Timeout of the COP timer (COP reset) An opcode fetch from an address not in the memory map (illegal address reset)
A reset does the following things to reinitialize the MCU: * * * * * * * Clears all implemented data direction register bits so that the corresponding I/O pins are inputs Loads the stack pointer with $FF Sets the interrupt mask, inhibiting interrupts Clears the TOFE and RTIE bits in the timer control and status register Clears the STOP latch, enabling the CPU clocks Clears the WAIT latch, waking the CPU from the WAIT mode Loads the program counter with the user-defined reset vector
5.1.1 Power-On Reset A positive transition on the VDD pin generates a power-on reset. The power-on reset is strictly for power-up conditions and cannot be used to detect drops in power supply voltage.
RESETS AND INTERRUPTS Rev. 2 For More Information On This Product, Go to: www.freescale.com 5-1
Freescale Semiconductor, Inc.
1 2 3 4 5
A 4064 tcyc (internal clock cycle) delay after the oscillator becomes active allows the clock generator to stabilize. If the RESET pin is at a logical zero at the end of 4064 tcyc, the MCU remains in the reset condition until the signal on the RESET pin goes to a logical one. 5.1.2 External Reset A zero applied to the RESET pin for one and one-half tcyc generates an external reset. A Schmitt trigger senses the logic level at the RESET pin. 5.1.3 Computer Operating Properly (COP) Reset A timeout of the COP timer generates a COP reset. The COP timer is part of a software error detection system and must be cleared periodically to start a new timeout period. (See 7.3 COP Timer.) To clear the COP timer and prevent a COP reset, write a zero to bit 0 (COPR) of the COP control register at location $0FF0 before the COP timer times out. The COP control register is a write-only register that returns the contents of an EPROM location when read. See Figure 5-1. COPR -- COP Control Register
Bit 7 -- RESET -- 6 -- -- 5 -- -- 4 -- -- 3 -- -- 2 -- -- 1 -- -- Bit 0 COPR 0
Freescale Semiconductor, Inc...
6 7 8 9
$0FF0
10 11 12 13 14
Figure 5-1. COP Control Register COPR -- COP Reset COPR is a write-only bit. Periodically writing a zero to COPR prevents the COP timer from resetting the MCU. 5.1.4 Illegal Address Reset An opcode fetch from an address that is not in the EPROM (locations $0700-$0EFF), or the RAM ($0090-$00FF) generates an illegal address reset.
15 16 17 18 19 20
RESETS AND INTERRUPTS 5-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
5.2 Interrupts An interrupt temporarily stops normal processing to process a particular event. Unlike a reset, an interrupt does not stop the operation of the instruction being executed. An interrupt takes effect when the current instruction completes its execution. An interrupt saves the CPU registers on the stack and loads the program counter with a user-defined interrupt vector address. The following conditions produce an interrupt: * * * Timer overflow or real-time interrupt request (timer interrupts) A logical zero applied to the IRQ pin (external interrupt) SWI instruction (software interrupt)
1 2 3 4 5 6 7
The CPU does the following things to begin servicing an interrupt:
Freescale Semiconductor, Inc...
*
Stores the contents of the CPU registers on the stack as shown in Figure 5-2
TOWARD LOWER ADDRESSES (LOWEST STACK ADDRESS IS $00C0) STACK 7 CONDITION CODE REGISTER ACCUMULATOR INTERRUPT RETURN INDEX REGISTER PROGRAM COUNTER HIGH PROGRAM COUNTER LOW UNSTACK TOWARD HIGHER ADDRESSES (HIGHEST STACK ADDRESS IS $00FF) 0
8 9 10 11 12 13 14 15 16 17 18 19 20
Figure 5-2. Interrupt Stacking Order * * Sets the interrupt mask to prevent further interrupts Loads the program counter with the contents of the appropriate interrupt vector locations: - $0FF8 and $0FF9 (timer interrupt vector) - $0FFA and $0FFB (external interrupt vector) - $0FFC and $0FFD (software interrupt vector)
RESETS AND INTERRUPTS Rev. 2 For More Information On This Product, Go to: www.freescale.com 5-3
Freescale Semiconductor, Inc.
1 2 3 4 5
The return from interrupt (RTI) instruction causes the CPU to recover the CPU registers from the stack as shown in Figure 5-2. 5.2.1 Timer Interrupts The timer generates two kinds of interrupts: * * Timer overflow interrupt Real-time interrupt
Setting the interrupt mask in the condition code register disables timer interrupts. 5.2.1.1 Timer Overflow Interrupts A timer overflow interrupt occurs if the timer overflow flag, TOF, becomes set while the timer overflow interrupt enable bit, TOIE, is also set. TOF and TOIE are in the timer control and status register. See 7.2 Timer Control and Status Register (TCSR). 5.2.1.2 Real-Time Interrupts A real-time interrupt occurs if the real-time interrupt flag, RTIF, becomes set while the real-time interrupt enable bit, RTIE, is also set. RTIF and RTIE are in the timer control and status register. See 7.2 Timer Control and Status Register (TCSR). 5.2.2 External Interrupt When a falling edge occurs on the IRQ pin, an external interrupt request is latched. When the CPU completes its current instruction, it tests the external interrupt latch. If the interrupt latch is set and the interrupt mask in the condition code register is reset, the CPU then begins the interrupt sequence. The CPU clears the interrupt latch while it fetches the interrupt vector, so that another external interrupt request can be latched during the interrupt service routine. As soon as the interrupt mask is cleared (usually during the return from interrupt), the CPU can recognize the new interrupt request. Figure 5-3 shows the sequence of events caused by an interrupt.
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
RESETS AND INTERRUPTS 5-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
FROM RESET
1 2
YES
INTERRUPT MASK SET ? NO
3 4
YES CLEAR IRQ REQUEST LATCH.
EXTERNAL INTERRUPT ?
5 6
Freescale Semiconductor, Inc...
NO
TIMER INTERRUPT ? NO
YES STACK PCL, PCH, X, A, CCR. SET INTERRUPT MASK. LOAD PC WITH VECTOR: MC68HC705J2 NATIVE MODE TIMER: $0FF8, $0FF9 EXTERNAL: $0FFA, $0FFB SOFTWARE: $0FFC, $0FFD MC68HC05J1 EMULATION MODE TIMER: $07F8, $07F9 EXTERNAL: $07FA, $07FB SOFTWARE: $07FC, $07FD
7 8 9 10 11
FETCH NEXT INSTRUCTION.
12 13
YES
SWI INSTRUCTION ? NO
14 15
RESTORE REGISTERS FROM STACK CCR, A, X, PCH, PCL.
RTI INSTRUCTION ? NO
YES
16 17 18
EXECUTE INSTRUCTION.
Figure 5-3. Interrupt Flowchart
19 20
RESETS AND INTERRUPTS Rev. 2 For More Information On This Product, Go to: www.freescale.com 5-5
Freescale Semiconductor, Inc.
1 2 3 4 5
Either an edge-sensitive or an edge- and level-sensitive external interrupt trigger is programmable in the mask option register. Figure 5-4 shows the internal logic of this programmable option.
LEVEL SENSITIVE TRIGGER (MOR OPTION) VDD EXTERNAL INTERRUPT REQUEST INTERRUPT MASK
D IRQ C
Q Q
Freescale Semiconductor, Inc...
6 7 8 9
R
RESET
EXTERNAL INTERRUPT BEING SERVICED (VECTOR FETCH)
Figure 5-4. External Interrupt Trigger Option The edge- and level-sensitive trigger option allows multiple external interrupt sources to be wire-ORed to the IRQ pin. With the level-sensitive trigger option, an external interrupt request is latched as long as any source is holding the IRQ pin low. Setting the interrupt mask in the condition code register disables external interrupts. 5.2.3 Software Interrupt The software interrupt (SWI) instruction causes a nonmaskable interrupt.
10 11 12 13 14 15 16 17 18 19 20
RESETS AND INTERRUPTS 5-6 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 6 MEMORY This section describes the organization of the on-chip memory. 6.1 Memory Map
2 3 4 5 6 7 8 9 10
Freescale Semiconductor, Inc...
The CPU can address 4 Kbytes of memory space. The program counter normally advances one address at a time through the memory, reading the program instructions and data. The EPROM portion of memory holds the program instructions, fixed data, user-defined vectors, and service routines. The RAM portion of memory holds variable data. I/O registers are memory-mapped so that the CPU can access their locations in the same way that it accesses all other memory locations. Figure 6-1 is a memory map of the MCU. Figure 6-2 is a more detailed memory map of the 32-byte I/O register section. 6.1.1 Input/Output Section The first 32 addresses of the memory space, $0000-$001F, are defined as the I/O section. These are the addresses of the I/O control registers, I/O status registers, and I/O data registers. 6.1.2 RAM The MCU has 112 bytes of fully static read/write memory for storage of variable and temporary data during program execution. RAM addresses $00C0-$00FF serve as the stack. The CPU uses the stack to save CPU register contents before processing an interrupt or subroutine call. The stack pointer decrements during pushes and increments during pulls.
11 12 13 14 15 16 17 18 19 20
NOTE Be careful if using the stack addresses ($00C0-$00FF) for data storage or as a temporary work area. The CPU may overwrite data in the stack during a subroutine or interrupt.
MEMORY Rev. 2 For More Information On This Product, Go to: www.freescale.com 6-1
Freescale Semiconductor, Inc.
1 2
$0000 I/O REGISTERS 32 BYTES UNUSED 112 BYTES $008F $0090 SRAM 112 BYTES PORT A DATA REGISTER PORT B DATA REGISTER UNUSED UNUSED PORT A DATA DIRECTION REGISTER PORT B DATA DIRECTION REGISTER UNUSED UNUSED TIMER CONTROL AND STATUS REGISTER TIMER COUNTER REGISTER UNUSED * * * UNUSED EPROM PROGRAMMING REGISTER UNUSED UNUSED RESERVED $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000A * * * $001B $001C $001D $001E $001F
3 4 5
$001F $0020
Freescale Semiconductor, Inc...
6 7 8 9
$00BF $00C0
STACK 64 BYTES $00FF $0100 UNUSED 1536 BYTES $06FF $0700
10 11 12 13 14 15 16
$0FFF $0FEF $0FF0 USER VECTORS (EPROM) 16 BYTES $0EFF $0F00 $0F01 MASK OPTION REGISTER COP REGISTER * USER EPROM 8 BYTES TIMER INTERRUPT VECTOR (HIGH) TIMER INTERRUPT VECTOR (LOW) EXTERNAL INTERRUPT VECTOR (HIGH) EXTERNAL INTERRUPT VECTOR (LOW) SOFTWARE INTERRUPT VECTOR (HIGH) SOFTWARE INTERRUPT VECTOR (LOW) RESET VECTOR (HIGH) RESET VECTOR (LOW) $0FF0 * * * $0FF7 $0FF8 $0FF9 $0FFA $0FFB $0FFC $0FFD $0FFE $0FFF USER EPROM 2048 BYTES
BOOTLOADER ROM 239 BYTES
17 18 19 20
MEMORY 6-2
*WRITING 0 TO BIT 0 OF $0FF0 CLEARS
COP TIMER. READING $0FF0 RETURNS USER EPROM DATA.
Figure 6-1. Memory Map
Rev. 2 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Bit 7 $0000 $0001 $0002 $0003 $0004 $0005 PA7 0 -- -- DDRA7 0 -- -- TOF Bit 7 -- -- --
6 PA6 0 -- -- DDRA6 0 -- -- RTIF 6 -- -- --
5 PA5 PB5 -- -- DDRA5 DDRB5 -- -- TOIE 5 -- -- --
4 PA4 PB4 -- -- DDRA4 DDRB4 -- -- RTIE 4 -- -- --
3 PA3 PB3 -- -- DDRA3 DDRB3 -- -- 0 3 -- -- --
2 PA2 PB2 -- -- DDRA2 DDRB2 -- -- 0 2 -- -- --
1 PA1 PB1 -- -- DDRA1 DDRB1 -- -- RT1 1 -- -- --
Bit 0 PA0 PB0 -- -- DDRA0 DDRB0 -- -- RT0 Bit 0 -- -- -- PORTA PORTB UNUSED UNUSED DDRA DDRB UNUSED UNUSED TCSR TCR UNUSED UNUSED UNUSED * * *
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
$0006 $0007 $0008 $0009 $000A $000B $000C * * * $0019 $001A $001B $001C $001D $001E $001F $0F00 $0FF0
-- -- -- 0 -- -- -- --
-- -- -- 0 -- -- -- --
-- -- -- 0 -- -- -- --
-- -- -- 0 -- -- -- --
-- -- -- 0 -- -- -- --
-- -- -- LATCH -- -- -- J1
-- -- -- 0 -- -- -- IRQ
-- -- -- EPGM -- -- -- COP COPR
UNUSED UNUSED UNUSED PROG UNUSED UNUSED RESERVED MOR COP
Figure 6-2. I/O Registers
MEMORY Rev. 2 For More Information On This Product, Go to: www.freescale.com 6-3
Freescale Semiconductor, Inc.
6.1.3 EPROM
1 2 3 4 5
Two Kbytes of user EPROM for storage of program instructions and fixed data are located at addresses $0700-$0EFF. The eight addresses from $0FF8-$0FFF are EPROM locations reserved for interrupt vectors and reset vectors. Eight additional EPROM bytes are located at $0FF0-$0FF8. There are two ways to write data to the EPROM: * * The EPROM programming register contains the control bits for programming the EPROM on a byte-by-byte basis. The bootloader ROM contains routines to download the contents of an external memory device to the on-chip EPROM.
Freescale Semiconductor, Inc...
6 7 8
6.1.3.1 EPROM Programming The EPROM programming register, shown in Figure 6-3, contains the control bits for programming the EPROM. PROG -- EPROM Programming Register
Bit 7 0 RESET 0 6 0 0 5 0 0 4 0 0 3 0 0 2 LATCH 0 1 0 0 Bit 0 EPGM 0
$001C
9
10 11 12 13 14 15 16 17 18 19 20
Figure 6-3. EPROM Programming Register (PROG) LATCH -- EPROM Bus Latch This read/write bit causes address and data buses to be latched for EPROM programming. Clearing the LATCH bit automatically clears the EPGM bit. 1 = Address and data buses configured for EPROM programming 0 = Address and data buses configured for normal operation EPGM -- EPROM Programming This read/write bit applies programming power to the EPROM. To write the EPGM bit, the LATCH bit must already be set. 1 = EPROM programming power switched on 0 = EPROM programming power switched off Bits 7-3 and 1 -- Not used; always read as zeros.
MEMORY 6-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
Take the following steps to program a byte of EPROM: 1. Apply 16.5 V to the IRQ/VPP pin. 2. Set the LATCH bit. 3. Write to any EPROM address. 4. Set the EPGM bit for a time tEPGM to apply the programming voltage. 5. Clear the LATCH bit. 6.1.3.2 EPROM Erasing The erased state of an EPROM bit is zero. Erase the EPROM by exposing it to 15 Ws/cm2 of ultraviolet light with a wavelength of 2537 angstroms. Position the ultraviolet light source 1 inch from the EPROM. Do not use a shortwave filter.
1 2 3 4 5 6 7 8 9
Freescale Semiconductor, Inc...
NOTE Windowed packages must have the window covered during programming and operation.
6.1.4 Bootloader ROM Addresses $0F01-$0FEF contain the bootloader ROM, which can copy and verify the contents of an external EPROM to the on-chip EPROM. See SECTION 8 BOOTLOADER MODE.
10 11 12 13 14 15 16 17 18 19 20
MEMORY
Rev. 2 For More Information On This Product, Go to: www.freescale.com
6-5
Freescale Semiconductor, Inc.
6.2 Data Retention Mode
1 2 3 4 5
In data retention mode, the MCU retains RAM contents and CPU register contents at VDD voltages as low as 2.0 Vdc. The data-retention feature allows the MCU to remain in a low power-consumption state during which it retains data, but the CPU cannot execute instructions. To put the MCU in data retention mode: 1. Drive the RESET pin to zero. 2. Lower the VDD voltage. The RESET line must remain low continuously during data retention mode. To take the MCU out of data retention mode: 1. Return VDD to normal operating voltage. 2. Return the RESET pin to logical one.
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
MEMORY 6-6 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 7 TIMER This section describes the operation of the timer and the COP timer. Figure 7-1 shows the organization of the timer system.
2 3 4 5
Freescale Semiconductor, Inc...
INTERNAL PROCESSOR CLOCK (XTAL / 2) LEAST SIGNIFICANT EIGHT BITS OF 15-STAGE RIPPLE COUNTER
6 7 8 9 10
/2
MSB
/2
/2
/2
/2
/2
/2
LSB
/2
FIXED DIVIDE BY 4
TIMER COUNTER REGISTER
TCR $0009
INTERRUPT CIRCUIT TOFE RTIE RTIF TOF
INTERRUPT REQUEST
11
0 0 TCSR $0008 RT1 RT0
TIMER CONTROL AND STATUS REGISTER
12 13
RTI RATE SELECT POWER-ON RESET (POR)
14 15 16 17 18 19 20
/2
/2
/2
/2
/2
/2
/2
MOST SIGNIFICANT SEVEN BITS OF 15-STAGE RIPPLE COUNTER
/2
CLEAR COP TIMER
/2
/2
S R
Q
COP TIMER RESET
Figure 7-1. Timer
TIMER Rev. 2 For More Information On This Product, Go to: www.freescale.com 7-1
Freescale Semiconductor, Inc.
7.1 Timer Counter Register (TCR)
1 2 3 4 5
A 15-stage ripple counter is the core of the timer. The value of the first eight stages is readable at any time from the read-only timer counter register shown in Figure 7-2 . TCR -- Timer Counter Register
Bit 7 RESET 0 6 0 5 0 4 0 3 0 2 0 1 0 Bit 0 0
$0009
Figure 7-2. Timer Counter Register (TCR) Power-on clears the entire counter chain and begins clocking the counter. After 4064 cycles of the internal clock, the power-on reset circuit is released, clearing the counter again and allowing the MCU to come out of reset. A timer overflow function at the eighth counter stage makes timer interrupts possible every 1024 internal clock cycles. 7.2 Timer Control and Status Register (TCSR) Timer interrupt flags, timer interrupt enable bits, and real-time interrupt rate select bits are in the read/write timer control and status register. TCSR -- Timer Control and Status Register
Bit 7 TOF RESET 0 6 RTIF 0 5 TOIE 0 4 RTIE 0 3 0 0 2 0 0 1 RT1 1 Bit 0 RT0 1
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
$0008
Figure 7-3. Timer Control and Status Register (TCSR)
TIMER 7-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
TOF -- Timer Overflow Flag This clearable, read-only bit becomes set when the first eight stages of the counter roll over from $FF to $00. TOF generates a timer overflow interrupt request if TOFE is also set. Clear TOF by writing a zero to it. Writing a one to TOF has no effect. RTIF -- Real-Time Interrupt Flag This clearable, read-only bit becomes set when the selected RTI output becomes active. RTIF generates a real-time interrupt request if RTIE is also set. Clear RTIF by writing a zero to it. Writing a one to RTIF has no effect. TOIE -- Timer Overflow Interrupt Enable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
This read/write bit enables timer overflow interrupts. 1 = Timer overflow interrupts enabled 0 = Timer overflow interrupts disabled RTIE -- Real-Time Interrupt Enable This read/write bit enables real-time interrupts 1 = Real-time interrupts enabled 0 = Real-time interrupts disabled Bits 3 and 2 -- Not used. Always read as zeros. RT1, RT0 -- Real-Time 1 and 0 These read/write bits select one of four real-time interrupt rates. See Table 7-1. The real-time interrupt rate should be selected by reset initialization software. A reset sets both RT1 and RT0, selecting the lowest real-time interrupt rate. Changing the real-time interrupt rate near the end of the RTI period or during a cycle in which the counter is switching can produce unpredictable results. Because the selected RTI output drives the COP timer, changing the real-time interrupt rate also changes the counting rate of the COP timer. Table 7-1. Real-Time Interrupt Rate Selection
RT1:RT0
00 01 10 11
RTI Rate
fop / 214 fop / fop / 215 217 fop / 216
RTI Period (fop = 2 MHz)
8.2 ms 16.4 ms 32.8 ms 65.5 ms
COP Timeout Period (-0/+1 RTI Period)
7 x RTI Period 7 x RTI Period 7 x RTI Period 7 x RTI Period
Minimum COP Timeout Period ( fop = 2 MHz)
57.3 ms 114.7 ms 229.4 ms 458.8 ms
TIMER Rev. 2 For More Information On This Product, Go to: www.freescale.com 7-3
Freescale Semiconductor, Inc.
7.3 COP Timer
1 2 3 4 5
Three counter stages at the end of the timer make up the computer operating properly (COP) timer. (See Figure 7-1 .) The COP timer is a software error detection system that automatically times out and resets the MCU if not cleared periodically by a program sequence. Writing a zero to bit 0 of the COP register clears the COP timer and prevents a COP timer reset. (See Figure 7-4.) COPR -- COP Register
Bit 7 -- RESET -- 6 -- -- 5 -- -- 4 -- --
$0FF0 MC68HC05J1 Emulation Mode: $07F0
3 -- -- 2 -- -- 1 -- -- Bit 0 COPC 0
Freescale Semiconductor, Inc...
6 7 8 9
Figure 7-4. COP Register (COPR) COPC -- COP Clear This write-only bit resets the COP timer. Reading address $0FF0 returns the EPROM data at that address.
10 11 12 13 14 15 16 17 18 19 20
TIMER 7-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 8 BOOTLOADER MODE This section describes how to use the bootloader ROM to download to the on-chip EPROM. 8.1 Bootloader ROM
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
The bootloader ROM, located at addresses $0F01-$0FEF, contains routines for copying to the on-chip EPROM from an external EPROM or from a personal computer. In MC68HC705J2 native mode, the bootloader copies to the 2 Kbyte space located at EPROM addresses $0700-$0EFF, the MOR byte at location $0F00, and the user vector addresses $0FF0-$0FFF. In MC68HC05J1 emulation mode, the bootloader copies to the 1 Kbyte space located at EPROM addresses $0300-$06FF, the MOR byte at location $0700, and the user vector addresses $07F0-$07FF. The addresses of the copied code must correspond to the internal addresses to which the code is copied. The bootloader ignores all other addresses. The COP timer is automatically disabled in bootloader mode. 8.1.1 External EPROM Downloading Figure 8-1 shows the circuit used to download to the on-chip EPROM from a 2764 EPROM. The bootloader circuit includes an external 12-bit counter to address the EPROM containing the code to be copied. Operation is fastest when unused external EPROM addresses contain $00.
BOOTLOADER MODE Rev. 2 For More Information On This Product, Go to: www.freescale.com 8-1
Freescale Semiconductor, Inc.
1 2 3 4 5
MC68JC705J2 19 VPP 18 IRQ/VPP PA0 1 17 OSC1 PA1 4 MHz 16 2 PA2 OSC2 15 PA3 14 PA4 10 M 13 PA5 12 15 pF 15 pF PA6 11 PA7 VDD S1 10 k 20 1F VDD 8 PB0 7 PB1
PROGRAM
2764 D0 D1 D2 D3 D4 D5 D6 D7 CE OE A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 10 k
MC14040B Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 RST CLK
Freescale Semiconductor, Inc...
6 7 8 9
330 S2
VERIFY
RESET VDD 9 4 PB4 3 PB5
VDD
VDD 10 k 10 k 1 2 3
6
PB2 CONNECT 2 AND 3 FOR MC68HC705J2 NATIVE MODE. CONNECT 1 AND 2 FOR MC68HC05J1 EMULATION MODE.
10 11 12 13 14 15 16 17 18 19 20
VSS 5 PB3
10
330
Figure 8-1. Bootloader Circuit The bootloader function begins when a rising edge occurs on the RESET pin while the IRQ/VPP pin is at VPP, the PB1 pin is at logical one, and the PB0 pin is grounded. The PB2 pin selects the bootloader function, as the following table shows. Table 8-1. Bootloader Function Selection
PB2
1 0 Verify
Bootloader Function
Program and Verify
BOOTLOADER MODE 8-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
Complete the following steps to bootload the MCU: 1. Turn off all power to the circuit. 2. Install the MCU and the EPROM. 3. Select the MCU mode: a. Install a jumper between points 2 and 3 to program the MCU as an MC68HC705J2. b. Install a jumper between points 1 and 2 to program the MCU as an MC68HC05J1. 4. Select the bootloader function: a. Open switch S2 to select the program and verify function. b. Close switch S2 to select the verify only function.
1 2 3 4 5 6 7 8 9 10 11 12
Freescale Semiconductor, Inc...
5. Close switch S1 to reset the MCU. 6. Apply VDD to the circuit. 7. Apply the EPROM programming voltage, VPP, to the circuit. 8. Open switch S1 to take the MCU out of reset. During programming the PROGRAM LED turns on. It turns off when the verification routine begins. If verification is successful, the VERIFY LED turns on. If the bootloader finds an error during verification, it puts the error address on the external address bus and stops running. 9. Close switch S1 to reset the MCU. 10. Remove the VPP voltage. 11. Remove the VDD voltage. 8.2 Host Downloading The MC68HC05P8EVS board supports downloading user programs directly from a personal computer. Refer to MC68HC05P8EVS Customer Specified Integrated Circuit (CSIC) Evaluation System, Motorola document number BR735/D.
13 14 15 16 17 18 19 20
BOOTLOADER MODE Rev. 2 For More Information On This Product, Go to: www.freescale.com 8-3
Freescale Semiconductor, Inc.
8.3 Mask Option Register (MOR)
1 2 3 4 5
The mask option register is an EPROM byte that contains three bits to control the following options: * * * MC68HC05J1 emulation mode External interrupt trigger sensitivity COP timer (enable/disable)
The mask option register is programmable only when using the bootloader function to download to the EPROM. MOR -- Mask Option Register
Bit 7 -- 6 -- 5 -- 4 --
Freescale Semiconductor, Inc...
6 7 8 9
$0F00 MC68HC05J1 Emulation Mode: $0700
3 -- 2 J1 1 IRQ Bit 0 COP
Figure 8-2. Mask Option Register (MOR) J1 -- MC68HC05J1 Emulation Mode Select This bit can be read at any time, but can be programmed only by the bootloader. 1 = Emulation mode selected; MCU functions as MC68HC05J1 0 = (Erased state) MC68HC705J2 native mode selected IRQ -- Interrupt Request This bit can be read at any time, but can be programmed only by the bootloader. 1 = IRQ trigger is both edge-sensitive and level-sensitive 0 = (Erased state) IRQ trigger is edge-sensitive only COP -- COP Timer Enable This bit can be read at any time, but can be programmed only by the bootloader. 1 = COP timer enabled 0 = (Erased state) COP timer disabled
10 11 12 13 14 15 16 17 18 19 20
NOTE To avoid unintentionally enabling any of the options in the MOR, the user should ensure that location $0F00 of the 8K external EPROM (2764) is programmed with either the appropriate value for the options to be enabled or $00. This is necessary because the erased state of an 8K external EPROM is $FF, whereas the erased state of the MOR is $00.
BOOTLOADER MODE 8-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1 2
SECTION 9 MC68HC05J1 EMULATION MODE This section describes how to use the MC68HC05J1 emulation mode to achieve compatibility with MC68HC05J1 devices.
3 4 5 6 7 8 9
Freescale Semiconductor, Inc...
9.1 Bootloading Use the bootloader function to put the MCU in MC68HC05J1 emulation mode. To activate the emulation mode: 1. Connect pin PB5 to VDD in the bootloader circuit. 2. Program the J1 bit (in the mask option register) high. 9.2 MC68HC05J1 Emulation In MC68HC05J1 emulation mode, the MCU operates as an MC68HC05J1 with the following exceptions: * * * The emulation mode does not support the RC oscillator mask option of the MC68HC05J1. The emulation mode does not support the STOP disable mask option of the MC68HC05J1. The emulation mode has no self-check function.
10 11 12 13 14 15 16 17 18 19 20
MC68HC05J1 EMULATION MODE Rev. 2 For More Information On This Product, Go to: www.freescale.com 9-1
Freescale Semiconductor, Inc.
9.3 Memory Map
1 2 3 4 5
Figure 9-1 shows the 2 Kbyte MC68HC05J1 emulation mode memory map.
$0000 $001F $0020
I/O REGISTERS 32 BYTES
UNUSED 160 BYTES $00BF $00C0 STACK RAM 64 BYTES $00FF $0100 UNUSED 512 BYTES
Freescale Semiconductor, Inc...
6 7 8 9
PORT A DATA REGISTER PORT B DATA REGISTER UNUSED UNUSED PORT A DATA DIRECTION REGISTER PORT B DATA DIRECTION REGISTER UNUSED UNUSED TIMER CONTROL & STATUS REGISTER TIMER COUNTER REGISTER UNUSED * * * UNUSED EPROM PROGRAMMING REGISTER UNUSED UNUSED RESERVED
$0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000A * * * $001B $001C $001D $001E $001F
$02FF $0300
10 11 12 13 14 15 16 17 18 19 20
MC68HC05J1 EMULATION MODE 9-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
$07EF $07F0 USER VECTORS (EPROM) 16 BYTES $07FF $06FF $0700 $0701 MASK OPTION REGISTER COP REGISTER * USER EPROM 8 BYTES TIMER INTERRUPT VECTOR (HIGH) TIMER INTERRUPT VECTOR (LOW) EXTERNAL INTERRUPT VECTOR (HIGH) EXTERNAL INTERRUPT VECTOR (LOW) SOFTWARE INTERRUPT VECTOR (HIGH) SOFTWARE INTERRUPT VECTOR (LOW) RESET VECTOR (HIGH) RESET VECTOR (LOW) $07F0 * * * $07F7 $07F8 $07F9 $07FA $07FB $07FC $07FD $07FE $07FF USER EPROM 1024 BYTES
BOOTLOADER ROM 239 BYTES
*WRITING 0 TO BIT 0 OF $07F0 CLEARS
COP TIMER. READING $07F0 RETURNS USER EPROM DATA.
Figure 9-1. MC68HC05J1 Emulation Mode Memory Map
Freescale Semiconductor, Inc.
1 2
SECTION 10 INSTRUCTION SET This section describes the M68HC705J1A addressing modes and instruction types.
3 4 5 6 7 8 9 10 11 12 13
Freescale Semiconductor, Inc...
10.1 Addressing Modes The CPU uses eight addressing modes for flexibility in accessing data. The addressing modes define the manner in which the CPU finds the data required to execute an instruction. The eight addressing modes are the following: * * * * * * * * Inherent Immediate Direct Extended Indexed, no offset Indexed, 8-bit offset Indexed, 16-bit offset Relative
10.1.1 Inherent Inherent instructions are those that have no operand, such as return from interrupt (RTI) and stop (STOP). Some of the inherent instructions act on data in the CPU registers, such as set carry flag (SEC) and increment accumulator (INCA). Inherent instructions require no memory address and are one byte long. 10.1.2 Immediate Immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. Immediate instructions require no memory address and are two bytes long. The opcode is the first byte, and the immediate data value is the second byte.
14 15 16 17 18 19 20
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com 10-1
Freescale Semiconductor, Inc.
10.1.3 Direct
1 2 3 4
Direct instructions can access any of the first 256 memory addresses with two bytes. The first byte is the opcode, and the second is the low byte of the operand address. In direct addressing, the CPU automatically uses $00 as the high byte of the operand address. BRSET and BRCLR are three-byte instructions that use direct addressing to access the operand and relative addressing to specify a branch destination. 10.1.4 Extended
5
Freescale Semiconductor, Inc...
6 7 8 9
Extended instructions use only three bytes to access any address in memory. The first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. When using the Motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. The assembler automatically selects the shortest form of the instruction. 10.1.5 Indexed, No Offset Indexed instructions with no offset are one-byte instructions that can access data with variable addresses within the first 256 memory locations. The index register contains the low byte of the conditional address of the operand. The CPU automatically uses $00 as the high byte, so these instructions can address locations $0000-$00FF. Indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used RAM or I/O location. 10.1.6 Indexed, 8-Bit Offset Indexed, 8-bit offset instructions are two-byte instructions that can access data with variable addresses within the first 511 memory locations. The CPU adds the unsigned byte in the index register to the unsigned byte following the opcode. The sum is the conditional address of the operand. These instructions can access locations $0000-$01FE. Indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. The table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01FE). The k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode.
10 11 12 13 14 15 16 17 18 19 20
INSTRUCTION SET 10-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
10.1.7 Indexed, 16-Bit Offset Indexed, 16-bit offset instructions are three-byte instructions that can access data with variable addresses at any location in memory. The CPU adds the unsigned byte in the index register to the two unsigned bytes following the opcode. The sum is the conditional address of the operand. The first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. These instructions can address any location in memory. Indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory.
1 2 3 4 5 6 7 8 9 10 11 12
Freescale Semiconductor, Inc...
As with direct and extended addressing the Motorola assembler determines the shortest form of indexed addressing. 10.1.8 Relative Relative addressing is only for branch instructions. If the branch condition is true, the CPU finds the conditional branch destination by adding the signed byte following the opcode to the contents of the program counter. If the branch condition is not true, the CPU goes to the next instruction. The offset is a signed, two's complement byte that gives a branching range of -128 to +127 bytes from the address of the next location after the branch instruction. When using the Motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch. 10.2 Instruction Types The MCU instructions fall into the following five categories: * * * * * Register/Memory Instructions Read-Modify-Write Instructions Jump/Branch Instructions Bit Manipulation Instructions Control Instructions
13 14 15 16 17 18 19 20
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com 10-3
Freescale Semiconductor, Inc.
10.2.1 Register/Memory Instructions
1 2 3 4 5
Most of these instructions use two operands. One operand is in either the accumulator or the index register. The CPU finds the other operand in memory. Table 10-1 lists the register/memory instructions. Table 10-1. Register/Memory Instructions
Instruction Add Memory Byte and Carry Bit to Accumulator Add Memory Byte to Accumulator AND Memory Byte with Accumulator Bit Test Accumulator Compare Accumulator Compare Index Register with Memory Byte EXCLUSIVE OR Accumulator with Memory Byte Load Accumulator with Memory Byte Load Index Register with Memory Byte Multiply OR Accumulator with Memory Byte Subtract Memory Byte and Carry Bit from Accumulator Store Accumulator in Memory Store Index Register in Memory Subtract Memory Byte from Accumulator Mnemonic ADC ADD AND BIT CMP CPX EOR LDA LDX MUL ORA SBC STA STX SUB
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
INSTRUCTION SET 10-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
10.2.2 Read-Modify-Write Instructions These instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. The test for negative or zero instruction (TST) is an exception to the read-modify-write sequence because it does not write a replacement value. Table 10-2 lists the read-modify-write instructions. Table 10-2. Read-Modify-Write Instructions
Instruction
Arithmetic Shift Left
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Mnemonic
ASL ASR BCLR BSET CLR COM DEC INC LSL LSR NEG ROL ROR TST
Freescale Semiconductor, Inc...
Arithmetic Shift Right Clear Bit in Memory Set Bit in Memory Clear Complement (One's Complement) Decrement Increment Logical Shift Left Logical Shift Right Negate (Two's Complement) Rotate Left through Carry Bit Rotate Right through Carry Bit Test for Negative or Zero
10.2.3 Jump/Branch Instructions Jump instructions allow the CPU to interrupt the normal sequence of the program counter. The unconditional jump instruction (JMP) and the jump to subroutine instruction (JSR) have no register operand. Branch instructions allow the CPU to interrupt the normal sequence of the program counter when a test condition is met. If the test condition is not met, the branch is not performed. All branch instructions use relative addressing. Bit test and branch instructions cause a branch based on the state of any readable bit in the first 256 memory locations. These three-byte instructions use a combination of direct addressing and relative addressing. The direct address of the byte to be tested is in the byte following the opcode. The third byte is the signed offset byte. The CPU finds the conditional branch destination by adding the third byte to the program counter if the specified bit tests true. The bit to be tested and
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com 10-5
15 16 17 18 19 20
Freescale Semiconductor, Inc.
1 2 3 4 5
its condition (set or clear) is part of the opcode. The span of branching is from -128 to +127 from the address of the next location after the branch instruction. The CPU also transfers the tested bit to the carry/borrow bit of the condition code register. See Table 10-3 lists the jump and branch instructions. Table 10-3. Jump and Branch Instructions
Instruction
Branch if Carry Bit Clear Branch if Carry Bit Set Branch if Equal
Mnemonic
BCC BCS BEQ BHCC BHCS BHI BHS BIH BIL BLO BLS BMC BMI BMS BNE BPL BRA BRCLR BRN BRSET BSR JMP JSR
Freescale Semiconductor, Inc...
6 7 8 9
Branch if Half-Carry Bit Clear Branch if Half-Carry Bit Set Branch if Higher Branch if Higher or Same Branch if IRQ Pin High Branch if IRQ Pin Low Branch if Lower Branch if Lower or Same Branch if Interrupt Mask Clear Branch if Minus Branch if Interrupt Mask Set Branch if Not Equal Branch if Plus Branch Always Branch if Bit Clear Branch Never Branch if Bit Set
10 11 12 13 14 15 16 17 18 19 20
Branch to Subroutine Unconditional Jump Jump to Subroutine
INSTRUCTION SET 10-6 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
10.2.4 Bit Manipulation Instructions The CPU can set or clear any writable bit in the first 256 bytes of memory. Port registers, port data direction registers, timer registers, and on-chip RAM locations are in the first 256 bytes of memory. The CPU can also test and branch based on the state of any bit in any of the first 256 memory locations. Bit manipulation instructions use direct addressing. Table 10-4 lists these instructions. Table 10-4. Bit Manipulation Instructions
Instruction Mnemonic BCLR BRCLR BRSET BSET
1 2 3 4 5 6 7 8
Freescale Semiconductor, Inc...
Clear Bit Branch if Bit Clear Branch if Bit Set Set Bit
10.2.5 Control Instructions These register reference instructions control CPU operation during program execution. Control instructions, listed in Table 10-5, use inherent addressing. Table 10-5. Control Instructions
Instruction Clear Carry Bit Clear Interrupt Mask No Operation Reset Stack Pointer Return from Interrupt Return from Subroutine Set Carry Bit Set Interrupt Mask Stop Oscillator and Enable IRQ Pin Software Interrupt Transfer Accumulator to Index Register Transfer Index Register to Accumulator Stop CPU Clock and Enable Interrupts Mnemonic CLC CLI NOP RSP RTI RTS SEC SEI STOP SWI TAX TXA WAIT
9 10 11 12 13 14 15 16 17 18 19 20
10-7
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
10.3 Instruction Set Summary
1 2 3 4 5
Table 10-6 is an alphabetical list of all M68HC05 instructions and shows the effect of each instruction on the condition code register. Table 10-6. Instruction Set Summary
Opcode Source Form
ADC #opr ADC opr ADC opr ADC opr,X ADC opr,X ADC ,X ADD #opr ADD opr ADD opr ADD opr,X ADD opr,X ADD ,X AND #opr AND opr AND opr AND opr,X AND opr,X AND ,X ASL opr ASLA ASLX ASL opr,X ASL ,X ASR opr ASRA ASRX ASR opr,X ASR ,X BCC rel
Operation
Description
HINZC
Freescale Semiconductor, Inc...
6 7 8 9
Add with Carry
A (A) + (M) + (C)
--
IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX REL
A9 ii B9 dd C9 hh ll D9 ee ff E9 ff F9 AB ii BB dd CB hh ll DB ee ff EB ff FB A4 ii B4 dd C4 hh ll D4 ee ff E4 ff F4 38 48 58 68 78 37 47 57 67 77 24 11 13 15 17 19 1B 1D 1F 25 27 dd
Add without Carry
A (A) + (M)
--
10 11 12 13 14 15 16 17 18 19 20
Logical AND
A (A) (M)
---- --
Arithmetic Shift Left (Same as LSL)
C b7 b0
0
----
ff dd
Arithmetic Shift Right
b7 b0
C
----
ff
Branch if Carry Bit Clear
PC (PC) + 2 + rel ? C = 0
----------
rr dd dd dd dd dd dd dd dd rr rr
BCLR n opr
Clear Bit n
Mn 0
DIR (b0) DIR (b1) DIR (b2) DIR (b3) ---------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) ---------- ---------- REL REL
BCS rel BEQ rel
Branch if Carry Bit Set (Same as BLO) Branch if Equal
PC (PC) + 2 + rel ? C = 1 PC (PC) + 2 + rel ? Z = 1
INSTRUCTION SET 10-8 For More Information On This Product, Go to: www.freescale.com Rev. 2
Cycles
2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 5 3 3 6 5 5 3 3 6 5 3 5 5 5 5 5 5 5 5 3 3
Effect on CCR
Operand
Address Mode
Freescale Semiconductor, Inc.
Table 10-6. Instruction Set Summary (Continued)
Opcode Source Form
BHCC rel BHCS rel BHI rel BHS rel
Operation
Branch if Half-Carry Bit Clear Branch if Half-Carry Bit Set Branch if Higher Branch if Higher or Same Branch if IRQ Pin High Branch if IRQ Pin Low
Description
PC (PC) + 2 + rel ? H = 0 PC (PC) + 2 + rel ? H = 1
Cycles
Effect on CCR HINZC
---------- ----------
Operand
Address Mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
REL REL REL REL REL REL IMM DIR EXT IX2 IX1 IX REL REL REL REL REL REL REL REL
28 29 22 24 2F 2E
rr rr rr rr rr rr
3 3 3 3 3 3 2 3 4 5 4 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 3
PC (PC) + 2 + rel ? C Z = 0 -- -- -- -- -- PC (PC) + 2 + rel ? C = 0 PC (PC) + 2 + rel ? IRQ = 1 PC (PC) + 2 + rel ? IRQ = 0 ---------- ---------- ----------
Freescale Semiconductor, Inc...
BIH rel BIL rel BIT #opr BIT opr BIT opr BIT opr,X BIT opr,X BIT ,X BLO rel BLS rel BMC rel BMI rel BMS rel BNE rel BPL rel BRA rel
Bit Test Accumulator with Memory Byte
(A) (M)
---- --
A5 ii B5 dd C5 hh ll D5 ee ff E5 ff F5 p 25 23 2C 2B 2D 26 2A 20 01 03 05 07 09 0B 0D 0F 00 02 04 06 08 0A 0C 0E 21 rr rr rr rr rr rr rr rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr rr
Branch if Lower (Same as BCS) Branch if Lower or Same Branch if Interrupt Mask Clear Branch if Minus Branch if Interrupt Mask Set Branch if Not Equal Branch if Plus Branch Always
PC (PC) + 2 + rel ? C = 1
----------
PC (PC) + 2 + rel ? C Z = 1 -- -- -- -- -- PC (PC) + 2 + rel ? I = 0 PC (PC) + 2 + rel ? N = 1 PC (PC) + 2 + rel ? I = 1 PC (PC) + 2 + rel ? Z = 0 PC (PC) + 2 + rel ? N = 0 PC (PC) + 2 + rel ? 1 = 1 ---------- ---------- ---------- ---------- ---------- ----------
BRCLR n opr rel Branch if bit n clear
PC (PC) + 2 + rel ? Mn = 0
DIR (b0) DIR (b1) DIR (b2) DIR (b3) -------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) DIR (b0) DIR (b1) DIR (b2) DIR (b3) -------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) ---------- REL
BRSET n opr rel Branch if Bit n Set
PC (PC) + 2 + rel ? Mn = 1
BRN rel
Branch Never
PC (PC) + 2 + rel ? 1 = 0
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com 10-9
Freescale Semiconductor, Inc.
Table 10-6. Instruction Set Summary (Continued)
Opcode Source Form Operation Description Cycles
5 5 5 5 5 5 5 5 6 2 2 dd 5 3 3 6 5 2 3 4 5 4 3 5 3 3 6 5 2 3 4 5 4 3 5 3 3 6 5 2 3 4 5 4 3
Effect on CCR HINZC
2 3 4 5
BSET n opr
Set Bit n
Mn 1
DIR (b0) DIR (b1) DIR (b2) DIR (b3) ---------- DIR (b4) DIR (b5) DIR (b6) DIR (b7)
10 12 14 16 18 1A 1C 1E
dd dd dd dd dd dd dd dd
Freescale Semiconductor, Inc...
6 7 8 9
BSR rel
Branch to Subroutine Clear Carry Bit Clear Interrupt Mask
PC (PC) + 2; push (PCL) SP (SP) - 1; push (PCH) SP (SP) - 1 PC (PC) + rel C0 I0 M $00 A $00 X $00 M $00 M $00
----------
REL
AD
CLC CLI CLR opr CLRA CLRX CLR opr,X CLR ,X CMP #opr CMP opr CMP opr CMP opr,X CMP opr,X CMP ,X COM opr COMA COMX COM opr,X COM ,X CPX #opr CPX opr CPX opr CPX opr,X CPX opr,X CPX ,X DEC opr DECA DECX DEC opr,X DEC ,X EOR #opr EOR opr EOR opr EOR opr,X EOR opr,X EOR ,X
-------- 0 -- 0 ------
INH INH DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX
98 9A 3F 4F 5F 6F 7F
Clear Byte
---- 0 1 --
10 11 12 13 14 15 16 17 18 19 20
Compare Accumulator with Memory Byte
(A) - (M)
----
A1 ii B1 dd C1 hh ll D1 ee ff E1 ff F1 33 43 53 63 73 dd
Complement Byte (One's Complement)
M (M) = $FF - (M) A (A) = $FF - (M) X (X) = $FF - (M) M (M) = $FF - (M) M (M) = $FF - (M)
---- 1
Compare Index Register with Memory Byte
(X) - (M)
---- 1
A3 ii B3 dd C3 hh ll D3 ee ff E3 ff F3 3A 4A 5A 6A 7A dd
Decrement Byte
M (M) - 1 A (A) - 1 X (X) - 1 M (M) - 1 M (M) - 1
---- --
EXCLUSIVE OR Accumulator with Memory Byte
A (A) (M)
---- --
A8 ii B8 dd C8 hh ll D8 ee ff E8 ff F8
INSTRUCTION SET 10-10 For More Information On This Product, Go to: www.freescale.com Rev. 2
Operand
rr ff ff ff
Address Mode
1
Freescale Semiconductor, Inc.
Table 10-6. Instruction Set Summary (Continued)
Opcode Source Form INC opr INCA INCX INC opr,X INC ,X JMP opr JMP opr JMP opr,X JMP opr,X JMP ,X JSR opr JSR opr JSR opr,X JSR opr,X JSR ,X LDA #opr LDA opr LDA opr LDA opr,X LDA opr,X LDA ,X LDX #opr LDX opr LDX opr LDX opr,X LDX opr,X LDX ,X LSL opr LSLA LSLX LSL opr,X LSL ,X LSR opr LSRA LSRX LSR opr,X LSR ,X MUL NEG opr NEGA NEGX NEG opr,X NEG ,X NOP Operation Description
M (M) + 1 A (A) + 1 X (X) + 1 M (M) + 1 M (M) + 1
Cycles
Effect on CCR HINZC
Operand
Address Mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Increment Byte
---- --
DIR INH INH IX1 IX DIR EXT IX2 IX1 IX DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX INH DIR INH INH IX1 IX INH
3C 4C 5C 6C 7C
dd
ff
5 3 3 6 5 2 3 4 3 2 5 6 7 6 5 2 3 4 5 4 3 2 3 4 5 4 3 5 3 3 6 5 5 3 3 6 5 11
Unconditional Jump
PC Jump Address
----------
Freescale Semiconductor, Inc...
BC dd CC hh ll DC ee ff EC ff FC BD dd CD hh ll DD ee ff ED ff FD A6 ii B6 dd C6 hh ll D6 ee ff E6 ff F6 AE ii BE dd CE hh ll DE ee ff EE ff FE 38 48 58 68 78 34 44 54 64 74 42 30 40 50 60 70 9D ii dd
Jump to Subroutine
PC (PC) + n (n = 1, 2, or 3) Push (PCL); SP (SP) - 1 Push (PCH); SP (SP) - 1 PC Conditional Address
----------
Load Accumulator with Memory Byte
A (M)
---- --
Load Index Register with Memory Byte
X (M)
---- --
Logical Shift Left (Same as ASL)
C b7 b0
0
----
ff
dd
Logical Shift Right
0 b7 b0
C
---- 0
ff
Unsigned Multiply
X : A (X) x (A) M -(M) = $00 - (M) A -(A) = $00 - (A) X -(X) = $00 - (X) M -(M) = $00 - (M) M -(M) = $00 - (M)
0 ------ 0
Negate Byte (Two's Complement)
----
ff
5 3 3 6 5 2
No Operation
----------
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com 10-11
Freescale Semiconductor, Inc.
Table 10-6. Instruction Set Summary (Continued)
Opcode Source Form
ORA #opr ORA opr ORA opr ORA opr,X ORA opr,X ORA ,X ROL opr ROLA ROLX ROL opr,X ROL ,X ROR opr RORA RORX ROR opr,X ROR ,X RSP
2 3 4 5
Operation
Description
HINZC
Logical OR Accumulator with Memory
A (A) (M)
---- --
IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX INH
AA ii BA dd CA hh ll DA ee ff EA ff FA 39 49 59 69 79 36 46 56 66 76 9C dd
Freescale Semiconductor, Inc...
6 7 8 9
Rotate Byte Left through Carry Bit
C b7 b0
----
ff dd
Rotate Byte Right through Carry Bit
C b7 b0
----
ff
Reset Stack Pointer
SP $00FF SP (SP) + 1; Pull (CCR) SP (SP) + 1; Pull (A) SP (SP) + 1; Pull (X) SP (SP) + 1; Pull (PCH) SP (SP) + 1; Pull (PCL) SP (SP) + 1; Pull (PCH) SP (SP) + 1; Pull (PCL)
----------
10 11 12 13 14 15 16 17 18 19 20
RTI
Return from Interrupt
INH
80
RTS SBC #opr SBC opr SBC opr SBC opr,X SBC opr,X SBC ,X SEC SEI STA opr STA opr STA opr,X STA opr,X STA ,X STOP STX opr STX opr STX opr,X STX opr,X STX ,X
Return from Subroutine
----------
INH IMM DIR EXT IX2 IX1 IX INH INH DIR EXT IX2 IX1 IX INH DIR EXT IX2 IX1 IX A2 ii B2 dd C2 hh ll D2 ee ff E2 ff F2 99 9B B7 dd C7 hh ll D7 ee ff E7 ff F7 8E BF dd CF hh ll DF ee ff EF ff FF 2 3 4 5 4 3 2 2 4 5 6 5 4 2 4 5 6 5 4
Subtract Memory Byte and Carry Bit from Accumulator
A (A) - (M) - (C)
----
Set Carry Bit Set Interrupt Mask
C1 I1
-------- 1 -- 1 ------
Store Accumulator in Memory
M (A)
---- --
Stop Oscillator and Enable IRQ Pin
-- 0 ------
Store Index Register In Memory
M (X)
---- --
INSTRUCTION SET 10-12 For More Information On This Product, Go to: www.freescale.com Rev. 2
Cycles
2 3 4 5 4 3 5 3 3 6 5 5 3 3 6 5 2 6
Effect on CCR
Operand
Address Mode
1
Freescale Semiconductor, Inc.
Table 10-6. Instruction Set Summary (Continued)
Opcode Source Form
SUB #opr SUB opr SUB opr SUB opr,X SUB opr,X SUB ,X
Operation
Description
Cycles
Effect on CCR HINZC
Operand
Address Mode
1 2 3 4 5
Subtract Memory Byte from Accumulator
A (A) - (M)
----
IMM DIR EXT IX2 IX1 IX
A0 ii B0 dd C0 hh ll D0 ee ff E0 ff F0
2 3 4 5 4 3
Freescale Semiconductor, Inc...
SWI
Software Interrupt
PC (PC) + 1; Push (PCL) SP (SP) - 1; Push (PCH) SP (SP) - 1; Push (X) SP (SP) - 1; Push (A) -- 1 ------ SP (SP) - 1; Push (CCR) SP (SP) - 1; I 1 PCH Interrupt Vector High Byte PCL Interrupt Vector Low Byte X (A) ----------
INH
83
10
6 7
TAX TST opr TSTA TSTX TST opr,X TST ,X TXA
Transfer Accumulator to Index Register
INH DIR INH INH IX1 IX INH
97 3D 4D 5D 6D 7D 9F dd
2 4 3 3 5 4 2
8 9 10 11 12 13 14 15 16 17 18 19 20
Test Memory Byte for Negative or Zero
(M) - $00
----------
ff
Transfer Index Register to Accumulator Stop CPU Clock and Enable Interrupts
A (X)
----------
WAIT
A C CCR dd dd rr DIR ee ff EXT ff H hh ll I ii IMM INH IX IX1 IX2 M N n
-- ------
opr PC PCH PCL REL rel rr SP X Z # () -( ) ? : --
INH
8F
2
Accumulator Carry/borrow flag Condition code register Direct address of operand Direct address of operand and relative offset of branch instruction Direct addressing mode High and low bytes of offset in indexed, 16-bit offset addressing Extended addressing mode Offset byte in indexed, 8-bit offset addressing Half-carry flag High and low bytes of operand address in extended addressing Interrupt mask Immediate operand byte Immediate addressing mode Inherent addressing mode Indexed, no offset addressing mode Indexed, 8-bit offset addressing mode Indexed, 16-bit offset addressing mode Memory location Negative flag Any bit
Operand (one or two bytes) Program counter Program counter high byte Program counter low byte Relative addressing mode Relative program counter offset byte Relative program counter offset byte Stack pointer Index register Zero flag Immediate value Logical AND Logical OR Logical EXCLUSIVE OR Contents of Negation (two's complement) Loaded with If Concatenated with Set or cleared Not affected
INSTRUCTION SET Rev. 2 For More Information On This Product, Go to: www.freescale.com 10-13
Freescale Semiconductor, Inc...
Table 10-7. Opcode Map
Read-Modify-Write Control Register/Memory IMM DIR EXT IX2 IX1
E
5 4
10-14 DIR INH INH IX1 IX INH
8 9
9 2 4 3 5
Branc Bit h Manipulation DIR DIR REL INH
A B C D
SUB
IX2 2 5
IX
F
3
MSB LSB
0 2 3 4 5 6 7
6 3 3 5 3
1
BRA
REL 2 3 INH 6 DIR 1 INH 1 INH 2 IX1 1 IX 1 2 IMM 2 2 DIR 3 3 EXT 3 4
MSB LSB SUB
5
5
0
NEG RTS
1 INH 11 2 IMM 2 2 DIR 3 3 EXT 3 4
BRSET0 BRN
REL 3
BSET0 CMP SBC
2 3 6 5 10 IMM 2 2 DIR 3 3 EXT 3 4
NEGA CMP SBC CPX
DIR 3 3
NEGX CMP SBC CPX
EXT 3 4
NEG CMP
IX2 2 5
NEG
RTI
SUB
SUB
SUB
SUB
IX1 1 4
3
DIR 2 5
DIR 2 5
IX 3
0
CMP
IX1 1 4
1
BHI
REL 3 5 INH 3 1
BRCLR0 MUL COM
DIR 1 5 INH INH 1 3 INH 2 3 IX1 1 6 IX 1 5 2 IMM 2 2
BCLR0 SBC
CMP
IX 3
3
DIR 2 5
DIR 2 5
1
SBC
IX2 2 5 IX1 1 4
2
BLS
REL 2 3
BRSET1 COMA LSRA
INH 1 IX INH 2 IX1 1 2 IMM 2 2
BSET1 COMX LSRX BIT
2 5 3 3 6 5 IMM 2 2
SBC
IX 3
3
DIR 2 5
DIR 2 5
2
CPX
IX2 2 5
3
COM LSR BIT
DIR 3 3
BRCLR1 BCC
REL 2 3 REL 3 DIR 1
BCLR1 LSR LSR AND AND
DIR 3 3
COM
SWI
CPX
CPX
IX1 1 4
CPX
IX 3
3
DIR 2 5
DIR 2 5
3
AND
EXT 3 4 IX2 2 5
4
BCS/BLO BNE
REL 2 3 IX 5 2 DIR 1 5 INH 1 3 INH 2 3 IX1 1 6 2
BRSET2
BSET2
AND BIT
EXT 3 4
AND
IX1 1 4
AND
IX 3
3
DIR 2 5
DIR 2 5
4
BIT
IX2 2 5
5
ROR ASR
DIR 1 5 IX 5 INH 2 INH 1 3 INH 2 3 IX1 1 6 1
BRCLR2 RORA ASRA ASL/LSL
IX 5 1
BCLR2 RORX ASRX CLC
INH 2 2
BIT
IX1 1 4
BIT
IX 3
3
DIR 2 5
DIR 2 5
5
LDA
DIR 3 4 EXT 3 5
6
ROR ASR ASR TAX ROR LDA BEQ
REL 2 3
BRSET3
BSET3
LDA STA
2 2 DIR 3 3
LDA
IX2 2 6
LDA
IX1 1 5
LDA
IX 4
3
DIR 2 5
DIR 2 5
IMM 2
6
STA
EXT 3 4
7
BHCC
REL 2 3 DIR 1 5 INH 1 3 INH 2 3 IX1 1 6
BRCLR3 ASL/LSL ASLA/LSLA ASLX/LSLX ASL/LSL ROL
DIR 1 5 IX 5 INH 1 3 INH 2 3 IX1 1 6 1
BCLR3
STA
IX2 2 5
STA
IX1 1 4
STA
IX 3
3
DIR 2 5
DIR 2 5
7
EOR
IMM 2 2
8
BHCS
REL 2 3
BRSET4 ROLA DECA
INH 1 IX INH 2 IX1 1
BSET4 ROLX DECX DEC DEC
1
EOR
DIR 3 3
EOR
EXT 3 4
EOR
IX2 2 5
EOR
IX1 1 4
EOR
IX 3
3
DIR 2 5
DIR 2 5
8
ADC
INH 2 2 IMM 2 2
INSTRUCTION SET
ROL ROL SEC CLI
INH 2 2
9
BPL
REL 2 3 DIR 1
BRCLR4 DEC
BCLR4
ADC
DIR 3 3
ADC
EXT 3 4
ADC
IX2 2 5
ADC
IX1 1 4
ADC
IX 3
3
DIR 2 5
DIR 2 5
9
ORA
IMM 2 2
A
BMI
REL 3 5 3 3 6
BRSET5
BSET5
ORA
DIR 3 3
ORA
EXT 3 4
ORA
IX2 2 5
ORA
IX1 1 4
ORA
IX 3
3
DIR 2 5
DIR 2 5
A
SEI
1
B
5
BRCLR5 BMC
REL 2 3 DIR 1 4 INH 1 3 INH 2 3 IX1 1 5
BCLR5 INC TST
DIR 1 INH 1 INH 2
ADD
INH 2 2 IMM 2
ADD
DIR 3 2
ADD
EXT 3 3
ADD
IX2 2 4
ADD
IX1 1 3
ADD
IX 2
3
DIR 2 5
DIR 2 5
B
RSP JMP JMP JMP JMP JMP
1 2 DIR 3 5 IX2 2 7 IX1 1 6
Freescale Semiconductor, Inc.
For More Information On This Product, Go to: www.freescale.com
INCA TSTA TSTX TST
IX1 1
C
INCX INC BMS
REL 2 3
BRSET6
BSET6
INC
IX 4
3
DIR 2 5
DIR 2 5
C
INH 2 6 EXT 3 6 IX 5
D
BIL
REL 3 5 3 3
BRCLR6
BCLR6
TST
IX 2 1
NOP
INH 2
BSR
REL 2 2
JSR
DIR 3 3
JSR
EXT 3 4
JSR
IX2 2 5
JSR
IX1 1 4
JSR
IX 3
3
DIR 2 5
DIR 2 5
D
STOP
1 6 5 INH 2 2 2
E
BIH
REL 2 DIR 1 INH 1
BRSET7 CLR CLRA CLRX
INH 2
BSET7
LDX
IMM 2
LDX
DIR 3 4
LDX
EXT 3 5
LDX
IX2 2 6
LDX
IX1 1 5
LDX
IX 4
3
DIR 2 5
DIR 2 5
E
CLR
IX1 1
F
BRCLR7
BCLR7
CLR
IX 1
WAIT
INH 1
TXA
INH 2
STX
DIR 3
STX
EXT 3
STX
IX2 2
STX
IX1 1
STX
IX
3
DIR 2
DIR 2
F
MSB LSB LSB of Opcode in Hexadecimal 0
3
0
MSB of Opcode in Hexadecimal
5 Number of Cycles
BRSET0 Opcode Mnemonic
DIR Number of Bytes/Addressing Mode
INH = Inherent IMM = Immediate DIR = Direct EXT = Extended
REL = Relative IX = Indexed, No Offset IX1 = Indexed, 8-Bit Offset IX2 = Indexed, 16-Bit Offset
Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 11 ELECTRICAL SPECIFICATIONS This section contains parametric and timing information. 11.1 Maximum Ratings
2 3 4 5 6 7 8
Value
-0.3 to +7.0
Freescale Semiconductor, Inc...
The MCU contains circuitry that protects the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in Table 11-1. Keep Vin and Vout within the range VSS (Vin or Vout) VDD. Connect unused inputs to the appropriate logical voltage level, either VSS or VDD. Table 11-1. Maximum Ratings
Rating
Supply Voltage Input Voltage All Pins in Normal Operation IRQ/VPP Pin in Bootloader Mode EPROM Programming Voltage (IRQ/VPP Pin) Current Drain Per Pin (ExcludingVDD and VSS) Operating Temperature Range MC68HC705J2P, DW (Standard) MC68HC705J2CP, CDW (Extended) MC68HC705J2VP, VDW Storage Temperature Range
Symbol
VDD Vin VPP I TA TSTG
Unit
V V V mA C C
9 10 11 12 13 14 15
VSS - 0.3 to VDD + 0.3 VSS - 0.3 to 2 x VDD + 0.3 16.75 25 0 to +70 -40 to +85 -40 to +105 -65 to +150
11.2 Thermal Characteristics Table 11-2. Thermal Resistance
Characteristic
Thermal Resistance PDIP SOIC
Symbol
JA
Value
60 60
Unit
C/W
16 17 18 19 20
ELECTRICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 11-1
Freescale Semiconductor, Inc.
11.3 Power Considerations
1 2 3 4 5
The average chip-junction temperature, TJ, in C, can be obtained from: TJ = TA + (PD x JA) where: TA = Ambient temperature, C JA = Package thermal resistance, junction to ambient, C/W PD = PINT + PI/O PINT = IDD x VDD watts (chip internal power) PI/O = Power dissipation on input and output pins (user-determined) For most applications PI/O << PINT and can be neglected. The following is an approximate relationship between PD and TJ (neglecting PI/O): PD = K / (TJ + 273 C) Solving equations (1) and (2) for K gives: K = PD x (TA + 273 C) + JA x (PD)2 (3) (2) (1)
Freescale Semiconductor, Inc...
6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
where K is a constant pertaining to the particular part. K can be determined from equation (3) by measuring PD (at equilibrium) for a known TA. Using this value of K, the values of PD and TJ can be obtained by solving equations (1) and (2) iteratively for any value of TA.
ELECTRICAL SPECIFICATIONS 11-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
11.4 DC Electrical Characteristics (VDD = 5.0 Vdc) Table 11-3. DC Electrical Characteristics (VDD = 5.0 Vdc)
Characteristic
Output Voltage Iload = 10.0 A Iload = -10.0 A Output High Voltage (Iload = -0.8 mA) PA7-PA0, PB5-PB0 Output Low Voltage (Iload = 1.6 mA) PA7-PA0, PB5-PB0 Input High Voltage PA7-PA0, PB5-PB0, IRQ/VPP, RESET, OSC1
1
Unit
V V V V V mA mA A A A A pF V mA ms
Symbol
VOL VOH VOH VOL VIH VIL
Min
-- VDD - 0.1 VDD - 0.8 -- 0.7 x VDD VSS -- -- -- --
Typ
-- -- -- -- -- -- 5.0 1.3 2.0 -- -- -- -- -- 16.5 5 --
Max
0.1 -- -- 0.4 VDD 0.2 x VDD 7.0 2.5 30 100 10 1 12 8 16.75 10 --
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
Input Low Voltage PA7-PA0, PB5-PB0, IRQ/VPP, RESET, OSC1 Supply Current (See NOTES.) Run Wait Stop 25 C -40 to +85 C I/O Ports High-Z Leakage Current PA7-PA0, PB5-PB0 Input Current RESET, IRQ/VPP, OSC1 Capacitance Ports (as input or output) RESET, IRQ/VPP Programming Voltage Programming Current Programming Time/Byte
IDD
IOZ Iin Cout Cin VPP IPP tEPGM
-- -- -- -- 16.25 -- 4
NOTES: 1. Typical values at midpoint of voltage range, 25 C only. 2. Run (operating) IDD and wait IDD measured using external square wave clock source (fosc = 4.2 MHz), all inputs 0.2 V from rail; no dc loads; less than 50 pF on all outputs; CL = 20 pF on OSC2. 3. Wait IDD and Stop IDD: all ports configured as inputs; VIL = 0.2 V, VIH = VDD - 0.2 V. 4. Stop IDD measured with OSC1 = VSS. 5. Standard temperature range is 0 C to 70 C. 6. OSC2 capacitance linearly affects Wait IDD . 7. Programming voltage measured at IRQ/VPP pin.
ELECTRICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 11-3
Freescale Semiconductor, Inc.
1 2 3 4 5
11.5 DC Electrical Characteristics (VDD = 3.3 Vdc) Table 11-4. DC Electrical Characteristics (VDD = 3.3 Vdc)
Characteristic
Output Voltage Iload = 10.0 A Iload = -10.0 A Output High Voltage (Iload = -0.2 mA) PA7-PA0, PB5-PB0 Output Low Voltage (Iload = 0.4 mA) PA7-PA0, PB5-PB0 Input High Voltage PA7-PA0, PB5-PB0, IRQ/VPP, RESET, OSC1 Input Low Voltage PA7-PA0, PB5-PB0, IRQ/VPP, RESET, OSC1 Supply Current (See NOTES.) Run Wait Stop 25 C -40 to +85 C I/O Ports High-Z Leakage Current PA7-PA0, PB5-PB0 Input Current RESET, IRQ/VPP, OSC1 Capacitance Ports (as input or output) RESET, IRQ/VPP
Symbol
VOL VOH VOH VOL VIH VIL
Min
-- VDD - 0.1 VDD - 0.3 -- 0.7 x VDD VSS -- -- -- --
Typ
-- -- -- -- -- -- 1.3 0.7 1.0 -- -- -- -- --
Max
0.1 -- -- 0.3 VDD 0.2 x VDD 2.0 1.0 20 50 10 1 12 8
Unit
V V V V V mA mA A A A A pF pF
Freescale Semiconductor, Inc...
6 7 8 9
IDD
Ioz Iin Cout Cin
10 11 12 13 14 15 16 17 18 19 20
-- -- -- --
NOTES: 1. Typical values at midpoint of voltage range, 25 C only. 2. Run (operating) IDD and Wait IDD measured using external square wave clock source (fosc = 2 MHz), all inputs 0.2 V from rail; no dc loads; less than 50 pF on all outputs; CL = 20 pF on OSC2. 3. Wait IDD and Stop IDD: all ports configured as inputs; VIL = 0.2 V, VIH = VDD - 0.2 V. 4. Stop IDD measured with OSC1 = VSS. 5. Standard temperature range is 0 C to 70 C. 6. OSC2 capacitance linearly affects Wait IDD .
VDD
R2 TEST POINT
PINS
PA7-PA0, PB5-PB0
VDD
4.5 V
R1
3.26 k 10.91 k
R2
2.38 k 6.32 k
C
50 pF 50 pF
C
R1
3.0 V
Figure 11-1. Equivalent Test Load
ELECTRICAL SPECIFICATIONS 11-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
800 mV 700 mV 600 mV VDD - VOH
SE
800 mV
EN
TE 1
OC E
NOT E
VDD - VOH
EN
C (S
AL
500 mV 400 mV 300 mV 200 mV 100 mV 0 0 -1.0 mA
(S E
SEE
NO
25
C
-40
C (S
EE
N
E OT
300 mV 200 mV
25
NO
85
N MI
C
85
AL
P
MI N
C RO
500 mV 400 mV
EE
S ES
OT
NO
PR
IN
E1
3
G
600 mV
SS
IN G
OT
E2
700 mV
)
1 2
)
1)
-4
0
C
(S
EE
C
NO
TE
1)
3 4
VDD = 3.3 V
VDD = 5.0 V
-2.0 mA -3.0 mA IOH -4.0 mA -5.0 mA
100 mV 0 0 -1.0 mA -2.0 mA
5
-5.0 mA
-3.0 mA IOH
-4.0 mA
Freescale Semiconductor, Inc...
6 7 8 9 10
NOTES: 1. Shaded area indicates variation in driver characteristics due to changes in temperature and for normal processing tolerances. Within the limited range of values shown, V vs I curves are approximately straight lines. 2. At VDD = 5.0 V, devices are specified and tested for (VDD - VOH) 800 mV @ IOL = -0.8 mA. 3. At VDD = 3.3 V, devices are specified and tested for (VDD - VOH) 300 mV @ IOL = -0.2 mA.
Figure 11-2. Typical High-Side Driver Characteristics
400 mV 350 mV 300 mV
400 mV
SE
SS
OT
NOT
)
IN
E1
CE
EN
EE
INA
RO
LP
OT
250 mV VOL
SS
250 mV VOL 200 mV 150 mV 100 mV
RO
CE
G
300 mV
E 1)
E2
SE
ING
EN
350 mV
O EN
TE
3
11 12
E 1)
SE
OM
C(
NA
200 mV 150 mV 100 mV 50 mV 0 0
25
C (S -40
EE
N
E OT
1)
-4
0
C
(S
25
EE
NO
85
T NO
13 14
VDD = 3.3 V
C (S 85
LP
C
VDD = 5.0 V
6.0 mA IOL 8.0 mA 10.0 mA
50 mV 0 0 2.0 mA 4.0 mA
CN
MI
15
10.0 mA
2.0 mA
4.0 mA
6.0 mA IOL
8.0 mA
16 17 18 19 20
NOTES: 1. Shaded area indicates variation in driver characteristics due to changes in temperature and for normal processing tolerances. Within the limited range of values shown, V vs I curves are approximately straight lines. 2. At VDD = 5.0 V, devices are specified and tested for VOL 400 mV @ IOL = 1.6 mA. 3. At VDD = 3.3 V, devices are specified and tested for VOL 300 mV @ IOL = 0.4 mA.
Figure 11-3. Typical Low-Side Driver Characteristics
ELECTRICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 11-5
Freescale Semiconductor, Inc.
1 2
SUPPLY CURRENT (IDD)
6.0 mA
5.0 mA
T = 25 C RUN MODE (OPERATING)
1.5 mA T = 25 C WAIT MODE SUPPLY CURRENT (IDD) 1.0 mA
3 4 5
4.0 mA
V .5 =5
.5 V
V DD
3.0 mA
V DD
=4 D VD
.5
V
.6 =3 V
.0 V
V
=4 DD
.5
V
.6 V
=5
2.0 mA
V DD
V DD
=3
V DD
=3
0.5 mA
V DD
=3
.0 V
Freescale Semiconductor, Inc...
6 7 8 9
7.0 mA
1.0 mA
0 0 500 kHz 1 MHz 1.5 MHz INTERNAL CLOCK FREQUENCY (XTAL 2) 2 MHz
0 0 500 kHz 1 MHz 1.5 MHz INTERNAL CLOCK FREQUENCY (XTAL 2) 2 MHz
Figure 11-4. Typical Supply Current vs Clock Frequency
T = -40 to +85 C VDD = 5 V 10% 6.0 mA
10 11
5.0 mA SUPPLY CURRENT (IDD)
5.0 mA T = -40 to +85 C VDD = 3.3 V 10%
12 13 14 15 16 17 18 19 20
4.0 mA SUPPLY CURRENT (IDD)
RU N
4.0 mA
3.0 mA
3.0 mA
2.0 mA
IT WA
2.0 mA
RU
1.0 mA
N
IT
1.0 mA
WA
0 0 500 kHz 1 MHz 1.5 MHz INTERNAL CLOCK FREQUENCY (XTAL 2) 2 MHz
0 0 500 kHz 1 MHz 1.5 MHz INTERNAL CLOCK FREQUENCY (XTAL 2) 2 MHz
NOTE: Maximum STOP IDD = 100 A when VDD = 5 V.
NOTE: Maximum STOP IDD = 50 A when VDD = 3 V.
Figure 11-5. Maximum Supply Current vs Clock Frequency
ELECTRICAL SPECIFICATIONS 11-6 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
11.6 Control Timing (VDD = 5.0 Vdc) Table 11-5. Control Timing (VDD = 5.0 Vdc)
(VDD = 5.0 Vdc 10%, VSS = 0 Vdc; TA = TL to TH)
1
Max
4.2 4.2 2.1 2.1 -- -- -- -- -- -- --
Characteristic
Oscillator Frequency Crystal Option External Clock Option Internal Operating Frequency Crystal (fosc / 2) External Clock (fosc / 2) Cycle Time RESET Pulse Width
Symbol
fosc
Min
-- dc -- dc 480 1.5 4.0 125 (NOTE 2) 90 4
Unit
MHz
2 3 4 5 6 7 8 9 10 11
fop tcyc tRL tRESL tILIH tILIL tOH, tOL tEPGM
MHz ns tcyc tcyc ns tcyc ns ms
Freescale Semiconductor, Inc...
Timer Resolution (NOTE 1) Interrupt Pulse Width Low (Edge-Triggered) Interrupt Pulse Period OSC1 Pulse Width Programming Time per Byte
NOTES: 1. The 2-bit timer prescaler is the limiting factor in determining timer resolution. 2. The minimum period tILIL should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 tcyc.
IRQ (PIN)
tILIH tILIL
12 13 14
NORMALLY USED WITH WIRED-OR CONNECTION
Edge-Sensitive Trigger -- The minimum tILIH is either 125 ns (VDD = 5 V) or 250 ns (VDD = 3 V). The period tILIL should not be less than the number of tcyc cycles it takes to execute the interrupt service routine plus 19 tcyc cycles.
IRQ 1
tILIH
IRQ n
15 16 17 18
IRQ (MCU)
Edge and Level-Sensitive Trigger -- If IRQ remains low after interrupt is serviced, the next interrupt is recognized.
Figure 11-6. External Interrupt Timing
19 20
ELECTRICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 11-7
Freescale Semiconductor, Inc.
1 2 3 4 5
11.7 Control Timing (VDD = 3.3 Vdc) Table 11-6. Control Timing (VDD = 3.3 Vdc)
(VDD = 3.3 Vdc 10%, VSS = 0 Vdc; TA = TL to TH)
Characteristic
Oscillator Frequency Crystal Option External Clock Option Internal Operating Frequency Crystal (fosc / 2) External Clock (fosc / 2) Cycle Time RESET Pulse Width Timer Resolution (NOTE 1) Interrupt Pulse Width Low (Edge-Triggered) Interrupt Pulse Period OSC1 Pulse Width
Symbol
fosc
Min
-- dc -- dc 1000 1.5 4.0 250 (NOTE 2) 400
Max
2.0 2.0 1.0 1.0 -- -- -- -- -- --
Unit
MHz
fop tcyc tRL tRESL tILIH tILIL tOH, tOL
MHz ns tcyc tcyc ns tcyc ns
Freescale Semiconductor, Inc...
6 7 8 9
NOTES: 1. The 2-bit timer prescaler is the limiting factor in determining timer resolution. 2. The minimum period tILIL should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 tcyc.
10 11 12 13 14 15 16 17 18 19 20
ELECTRICAL SPECIFICATIONS 11-8 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
OSC1 1
1
tRL
RESET
2 3
tILCH 4064 tcyc
IRQ 2
tILIH
IRQ 3
4 5
INTERNAL CLOCK
Freescale Semiconductor, Inc...
INTERNAL ADDRESS BUS
FFE 4
FFE 4
FFE 4
FFF 4
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
NOTES: 1. Represents internal gating of OSC1 pin. 2. IRQ pin edge-sensitive mask option. 3. IRQ pin level and edge-sensitive mask option. 4. Reset vector address of MC68HC705J2 native mode shown as timing example.
RESET OR INTERRUPT VECTOR FETCH
Figure 11-7. STOP Recovery Timing
ELECTRICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 11-9
Freescale Semiconductor, Inc.
1 2 3 4 5
INTERNAL CLOCK 1 VDD
tVDDR POR THRESHOLD (TYPICALLY 1-2 V)
OSC1 PIN
4064 tcyc
Freescale Semiconductor, Inc...
6 7 8 9
INTERNAL ADDRESS BUS 1 INTERNAL DATA BUS 1
0FFE2
0FFE2
0FFE2
0FFE2
0FFE2
0FFE2
0FFF 3
NEW PCH
NEW PCL
NOTES: 1. Internal clock, internal address bus, and internal data bus are not available externally. 2. Address of high byte of reset vector is $0FFE in MC68HC705J2 native mode and $07FE in MC68HC05J1 emulation mode. 3. Address of low byte of reset vector is $0FFF in MC68HC705J2 native mode and $07FF in MC68HC05J1 emulation mode.
10 11 12 13 14 15 16 17 18 19 20
INTERNAL CLOCK 1 INTERNAL ADDRESS BUS 1 INTERNAL DATA BUS 1
Figure 11-8. Power-On Reset Timing
0FFE3
0FFE3
0FFE3
0FFE3
0FFF 4
NEW PC
NEW PC
NEW PCH tRL
NEW PCL
DUMMY
OP CODE
RESET 2
NOTES: 1. Internal clock, internal address bus, and internal data bus signals are not available externally. 2. Next rising edge of internal clock after rising edge of RESET initiates reset sequence. 3. Address of high byte of reset vector is $0FFE in MC68HC705J2 native mode and $07FE in MC68HC05J1 emulation mode. 4. Address of low byte of reset vector is $0FFF in MC68HC705J2 native mode and $07FF in MC68HC05J1 emulation mode.
Figure 11-9. External Reset Timing
ELECTRICAL SPECIFICATIONS 11-10 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
1
SECTION 12 MECHANICAL SPECIFICATIONS The MC68HC705J2 is available in the following packages: * * 738-03 -- plastic dual in-line package (PDIP) 751D-04 -- small outline integrated circuit (SOIC) 732-03 -- ceramic DIP (Cerdip) (windowed)
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Freescale Semiconductor, Inc...
*
The following figures show the latest packages at the time of this publication. To make sure that you have the latest package specifications, contact one of the following: * * Local Motorola Sales Office Motorola Mfax - Phone 602-244-6609 - EMAIL rmfax0@email.sps.mot.com Worldwide Web (wwweb) at http://design-net.com
*
Follow Mfax or Worldwide Web on-line instructions to retrieve the current mechanical specifications.
MECHANICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 12-1
Freescale Semiconductor, Inc.
12.1 Plastic Dual In-Line Package (DIP)
1 2 3 4 5
-TSEATING PLANE 20 1
-A11 NOTES: 1. DIMENSIONING AND TOLERANCING PER ANSI Y14.5M, 1982. 2. CONTROLLING DIMENSION: INCH. 3. DIMENSION L TO CENTER OF LEAD WHEN FORMED PARALLEL. 4. DIMENSION B DOES NOT INCLUDE MOLD FLASH. DIM A B C D E F G J K L M N INCHES MIN MAX 1.010 1.070 0.240 0.260 0.150 0.180 0.015 0.022 0.050 BSC 0.050 0.070 0.100 BSC 0.008 0.015 0.110 0.140 0.300 BSC 15 0 0.020 0.040 MILLIMETERS MIN MAX 25.66 27.17 6.10 6.60 3.81 4.57 0.39 0.55 1.27 BSC 1.27 1.77 2.54 BSC 0.21 0.38 2.80 3.55 7.62 BSC 0 15 0.51 1.01
B
10
C
L
K M E G F D 20 PL 0.25 (0.010)
M
Freescale Semiconductor, Inc...
6 7 8 9
N J 20 PL 0.25 (0.010) TA
M
M
TB
M
Figure 12-1. MC68HC705J2P (Case 738-03)
10 11 12 13 14 15 16 17 18 19 20
MECHANICAL SPECIFICATIONS 12-2 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
12.2 Small Outline Integrated Circuit (SOIC)
-A20 11 NOTES: 1. DIMENSIONING AND TOLERANCING PER ANSI Y14.5M, 1982. 2. CONTROLLING DIMENSION: MILLIMETER. 3. DIMENSIONS A AND B DO NOT INCLUDE MOLD PROTRUSION. 4. MAXIMUM MOLD PROTRUSION 0.150 (0.006) PER SIDE. 5. DIMENSION D DOES NOT INCLUDE DAMBAR PROTRUSION. ALLOWABLE DAMBAR PROTRUSION SHALL BE 0.13 (0.005) TOTAL IN EXCESS OF D DIMENSION AT MAXIMUM MATERIAL CONDITION. DIM A B C D F G J K M P R MILLIMETERS MIN MAX 12.65 12.95 7.40 7.60 2.35 2.65 0.35 0.49 0.50 0.90 1.27 BSC 0.25 0.32 0.10 0.25 0 7 10.05 10.55 0.25 0.75 INCHES MIN MAX 0.499 0.510 0.292 0.299 0.093 0.104 0.014 0.019 0.020 0.035 0.050 BSC 0.010 0.012 0.004 0.009 0 7 0.395 0.415 0.010 0.029
1 2 3 4 5 6 7 8
-B-
P 10 PL 0.010 (0.25)
M
B
M
1
10
D
20 PL
0.010 (0.25)
M
TA
S
B
S
J
F
Freescale Semiconductor, Inc...
R X 45 C -TG
18 PL SEATING PLANE
K
M
Figure 12-2. MC68HC705J2DW (Case 751D-04)
9 10 11 12 13 14 15 16 17 18 19 20
MECHANICAL SPECIFICATIONS Rev. 2 For More Information On This Product, Go to: www.freescale.com 12-3
Freescale Semiconductor, Inc.
12.3 Ceramic DIP (Cerdip)
1 2 3 4 5
20 1 11 10 NOTES: 1. LEADS WITHIN 0.010 DIAMETER, TRUE POSITION AT SEATING PLANE, AT MAXIMUM MATERIAL CONDITION. 2. DIMENSION L TO CENTER OF LEADS WHEN FORMED PARALLEL. 3. DIMENSIONS A AND B INCLUDE MENISCUS.
B A F C L
DIM A B C D F G H J K L M N
Freescale Semiconductor, Inc...
6 7
H
N D
SEATING PLANE
8 9
G
K
J M
INCHES MIN MAX 0.940 0.990 0.260 0.295 0.150 0.200 0.015 0.022 0.055 0.065 0.100 BSC 0.020 0.050 0.008 0.012 0.125 0.160 0.300 BSC 0_ 15_ 0.010 0.040
Figure 12-3. MC68HC705J2S (Case 732-03)
10 11 12 13 14 15 16 17 18 19 20
MECHANICAL SPECIFICATIONS 12-4 For More Information On This Product, Go to: www.freescale.com Rev. 2
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Home Page: www.freescale.com email: support@freescale.com USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 (800) 521-6274 480-768-2130 support@freescale.com Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku Tokyo 153-0064, Japan 0120 191014 +81 2666 8080 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate, Tai Po, N.T., Hong Kong +800 2666 8080 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 (800) 441-2447 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor @hibbertgroup.com
RoHS-compliant and/or Pb- free versions of Freescale products have the functionality and electrical characteristics of their non-RoHS-compliant and/or non-Pb- free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale.s Environmental Products program, go to http://www.freescale.com/epp.
Freescale Semiconductor, Inc...
Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters which may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part.
For More Information On This Product, Go to: www.freescale.com
MC68HC705J2/D


▲Up To Search▲   

 
Price & Availability of MC68HC705J2

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X